Add/Modify Stored Procedure Call Notebook
The Add/Modify Stored Procedure Call notebook allows you to add or modify a
user-defined method that calls a database stored procedure. The method is added to the
generated <class> or <class>Manager class, depending on
what it returns. If the stored procedure call returns a result set from the table, then
the method is added to the <class>Manager class; define this type of
stored procedure call by launching this notebook from the Manager Methods dialog.
Otherwise, if the stored procedure returns anything else, then the method is added to the <class>
class; define this type of stored procedure call by launching this notebook from the
Methods dialog.
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:
- OK - Enabled when changes have been made to the notebook. Clicking it
applies the changes and exits the notebook.
- Cancel - Cancels any changes made to the notebook and exits.
- Apply - Enabled when changes have been made to the notebook. Clicking
it applies the changes.
- Help - Accesses online help for the notebook.
Stored Procedure Page
The Stored Procedure page lets you enter a name and an Stored Procedure name to
define the method. It contains the following elements:
- Method Name field - Provide a method name for use in
the generated code. This field does not accept double-byte characters, because the
generated code cannot have methods with double-byte character names. If you want to
associate a double-byte character name with this method, use the Display Name
field.
- Procedure Name drop-down list - All stored procedures that have been
defined to Data Access Builder appear in this list. If the one you want to use is not in
this list, click the Show Procedures button.
- Show Procedures button - Click this button if the stored procedure call
you want to use does not appear in the Procedure Name drop-down list.
This will launch the Stored Procedures List window,
which lets you import stored procedures and their definitions from the database and add
them to the drop-down list.
- Display Name field - Specify a name for the method that is to be used
in application builders such as the Visual Builder. This can contain double-byte
characters. Note that the name of the method as it appears in the generated code is set in
the Method Name field, which cannot contain double-byte characters.
Parameter Page
The Parameter page lets you map method parameters from the stored procedure definition to
corresponding parts of the C++ method, and to C++ types. Each parameter is displayed in
the Parameters container, 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:
- Parameter - Maps the parameter to a method parameter (that is, one of
the parameters passed in to the method when it is called). Selecting this radio button
enables the Name and Type fields to the right. Enter a
name for the parameter, and select a C++ type. Only those C++ types that are appropriate,
given the parameter's SQL type, are provided.
- Attribute - Maps the parameter to an attribute of <class>.
The current persistent object's corresponding attribute value is used for method input or
is assigned an output value, depending on what the user-defined method does. Selecting
this radio button enables the Name and Type fields to
the right. In the Name field, select the desired attribute. Only those
attributes that are appropriate, given the parameter's SQL type, are provided.
- Return Value - Maps the parameter to a value returned by the method.
Selecting this radio button enables the Type field to the right. Only those C++ types that
are appropriate, given the parameter's SQL type, are provided.
- None - Removes the selected parameter from the method mapping.
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

Define Stored Procedures
Display the List of Defined Stored Procedures

Sample: Create and Use a Stored Procedure Call on
a Persistent Object