Permanently updates all database operations since the previous COMMIT, ROLLBACK, or CONNECT for the specified transaction object.
Using COMMIT and ROLLBACK in a server component COMMIT and ROLLBACK commands embedded in a server component might have different effects depending on the setting of the UseContextObject DBParm parameter.
For information on the UseContextObject parameter see Connecting to Your Database. For information on deploying components to a transaction server, see Application Techniques.
COMMIT {USING TransactionObject};
Parameter |
Description |
---|---|
TransactionObject |
The name of the transaction object for which you want to permanently update all database operations since the previous COMMIT, ROLLBACK, or CONNECT. This clause is required only for transaction objects other than the default (SQLCA). |
COMMIT does not cause a disconnect, but it does close all open cursors or procedures. (But note that the DISCONNECT statement in PowerBuilder does issue a COMMIT.)
Error handling It is good practice to test the success/failure code after executing a COMMIT statement.
Example 1 This statement commits all operations for the database specified in the default transaction object:
COMMIT ;
Example 2 This statement commits all operations for the database specified in the transaction object named Emp_tran:
COMMIT USING Emp_tran ;