Using the Stored Procedure part
You add stored procedure functions to your application in VA Smalltalk using the Stored Procedure visual part in the Composition Editor. To add a stored procedure to an application's view, follow these steps:
1. Select
, the Stored Procedure part, from the parts palette and add it to the free-form surface of the Composition Editor
2. Open the part's settings view.
VA Smalltalk displays the Stored Procedure Settings window, as shown in the following illustration.
3. Select the connection alias and access set name for your database from the drop-down lists on the dialog.
4. To add a new stored procedure specification to the access set, select New.
VA Smalltalk displays the Stored Procedure Specification Settings window as shown below.
Note:
If you are using DB2, refer to the DB2 Call Level Interface Guide and Reference for more information.
5. Define the stored procedure by completing the fields on this window as follows:
Name
Type a valid Smalltalk method name for the stored procedure specification. VA Smalltalk uses this name to identify the stored procedure specification. Each stored procedure specification requires a unique name. If you change the name of an existing stored procedure specification, a new one is created with the new name, and the old continues to exist too. After you define your new stored procedure specification, its name appears in the Stored Procedure Spec Name field when you return to the Stored Procedure Settings window.
Description
Type a description of the function of the stored procedure application. The information in this field is not required. After you create and apply a new stored procedure specification, the description that you type in this field appears in the Stored Procedure Settings window.
Procedure name
Select the procedure name from the list.
DB2 CLI procedures will not show up unless the DB2CLI.PROCEDURES table on the DB2 server includes an entry for each procedure.
If you use ORACLE and you have defined stored procedures in packages, then those stored procedures will not show up in the combo box. You can type the procedure name into this field as <package>.procedure. Replace package with the package name and procedure with the procedure name.
Input/Output variables
If the stored procedure application uses parameters, you can either define variables manually, or you can automatically query the database for a list of variables.
To define variables manually, place the mouse pointer in this field and press button 2. Select either Add before or Add After to add variables in the correct order, or Edit to edit existing variables. On the Stored Procedure Host Variable window, define the variable, including the bind type (Input, Input/Output, Output, Return Value), then select OK. After you have added variables, you can also delete them from the pop-up menu.
To automatically query the database for parameter shapes and display them in this list , place the mouse pointer in this field and press button 2, then select Get schema. This adds all of the variables in your stored procedure.
Note:
Not all ODBC data sources support Get schema.
6. After you create the stored procedure specification, select OK in the Stored Procedure Settings window.
Last modified date: 06/01/2018