Updates to the database can now be performed using stored procedures. The DataWindow control submits updates to the database by dynamically generating INSERT, DELETE, and UPDATE SQL statements after determining the status of each row in the DataWindow object. Now you can also define procedural SQL statements in a stored procedure for use by all applications accessing a database. Using stored procedures to perform database updates allows you to enhance database security, integrity, and performance. Since stored procedures provide for conditional execution, you can also use them to enforce additional business rules.
In the DataWindow painter, select Rows>Stored Procedure Update to display the Stored Procedure Update dialog box. Select the tab for the SQL update method (Delete, Insert, or Update) with which you want to associate a stored procedure. Select the stored procedure you want to be executed when the SQL update method is generated.
The stored procedure you associate with a SQL update method in the Stored Procedure Update dialog box is executed when the DataWindow control calls the Update function. The DataWindow control examines the table in the DataWindow object, determines the appropriate SQL statement for each row, and submits the appropriate stored procedure (as defined in the Stored Procedure Update dialog box) with the appropriate column values substituted for the procedure arguments.
You can use the DataWindow Describe and Modify functions to access DataWindow property values including the stored procedures associated with a DataWindow object.