602SQL Documentation Index  

COMMIT Statement

statement_COMMIT :: COMMIT [ WORK ] [ AND [ NO ] CHAIN ]

The COMMIT statement terminates a running transaction (default or explicit). All modifications made in this transaction are saved to the database and become visible to all clients. All temporary locks placed on the records during the transaction are removed.

If an error occurs when executing the COMMIT statement or if the actions made in the transaction broke some integrity constraint, explicit rollback is done immediately and the transaction is rolled back as a whole.

The COMMIT statement removes all savepoints created in the transaction.

If the COMMIT statement is executed inside a stored procedure, a new default transaction will be executed with the same properties.

If the AND CHAIN phrase is specified (even when outside a routine), then a new transaction with the same properties as the current transaction will begin after this transaction is complete.

If the COMMIT statement is executed inside an atomic block or a trigger, the error sqlstate 2D000 occurs.