Go to Glossary Search VisualAge C++ Help Go to VisualAge C++ Help Home Page Go to WWW VisualAge C++ Site

Add/Modify Customized SQL Statement Notebook

The Add/Modify Customized SQL Statement notebook allows you to add or modify a user-defined method that is created using an SQL Statement. The method is added to the generated <class>. A live connection to the database is required so you can validate the SQL statement.

The notebook has the following pages. Select a link to see details for the corresponding page:

Select the appropriate tab to move around the notebook. The following buttons appear at the bottom:

SQL Statement Page
The SQL Statement page lets you enter a name and an SQL statement to define the method. It contains the following elements:

SQL Type Page
The SQL Type page shows the SQL types for the parameters in the SQL statement. All of the information fields are filled in automatically when the statement is validated, and cannot be changed. The only exception to this occurs when the validation process is unable to determine the SQL type of one or more of the parameters. Then, you must provide the missing information, as described below.

Each parameter is displayed in the Parameters container. To view a parameter's SQL mapping, select it; the fields below are updated with the information for the selected parameter. If the SQL type of a parameter is known, all these fields will be static; there will also be a check-mark to the left of the parameter name in the Parameters container. If the SQL type of a parameter is unknown, there will be an "X" to the left of the parameter name; make the appropriate setting changes, and click the Modify button. The following fields are shown:

Parameter Page
The Parameter page lets you map method parameters to corresponding parts of the C++ method, and to C++ types. Each parameter is displayed in the Parameters list box, and is modified by changing the fields below. Work with one parameter at a time by selecting one, making the desired changes, and clicking the Modify button when you are done; then, select the next parameter.

Use the Mapped To radio buttons to modify the parameter mapping. There are four radio buttons for selecting what part of the method the parameter is mapped to. Only those options that are applicable to the parameter type are enabled. Select one of the following:

Click the Modify button when you are done with a parameter.

Comment Page
The Comment page lets you enter a comment for the user-defined method. The comment will be added to the generated code along with the method's C++ code.



User-Defined Methods


Data Access Class Library and Generated Code
Sample: Create and Use a User-Defined Method With Customized SQL Statement