COMMIT

Description

Permanently updates all database operations since the previous COMMIT, ROLLBACK, or CONNECT for the specified transaction object.

NoteUsing 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.

Syntax

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).

Usage

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.)

NoteError handling It is good practice to test the success/failure code after executing a COMMIT statement.

Examples

Example 1

Example 1 This statement commits all operations for the database specified in the default transaction object:

COMMIT ;

Example 2

Example 2 This statement commits all operations for the database specified in the transaction object named Emp_tran:

COMMIT USING Emp_tran ;