Using stored procedures as DataWindow data sources
You can use a database stored procedures as a data source for DataWindow objects. The following rules apply:
-
Result set definition
You must define what the result set looks like. The DataWindow object cannot determine this information from the stored procedure definition in the database.
-
DataWindow updates
You cannot perform DataWindow updates through stored procedures (that is, you cannot update the database with changes made in the DataWindow object); only retrieval is allowed. (However, the DataWindow can have update characteristics set manually through the DataWindow painter.)
-
Result set processing
You can specify only one result set to be processed when you define the stored procedure result set in the DataWindow painter. However, the result set you select does not have to be the first result set.
-
Computed rows
Computed rows cannot be processed in a DataWindow.
Database stored procedures summary
When you use database stored procedures in a PowerBuilder application, keep the following points in mind:
-
Manipulating stored procedures
To manipulate database stored procedures, PowerBuilder provides SQL statements that are similar to cursor statements.
-
Retrieval and update
PowerBuilder supports retrieval, update, or a combination of retrieval and update in database stored procedures, including procedures that return no results sets and those that return one or more result sets.
-
Transactions and stored procedures with result sets
When a procedure executes successfully using a specific connection (transaction) and returns at least one result set, no other SQL commands can be executed using that connection until the procedure has been closed.
-
Transactions and stored procedures without result sets
When a procedure executes successfully using a specific transaction but does not return a result set, the procedure is no longer active. No result sets are pending, and therefore you should not execute a CLOSE statement.