Was this helpful?
COMMIT
Valid in: SQL, ESQL, DBProc, OpenAPI, ODBC, JDBC, .NET
The COMMIT statement commits the current transaction.
The COMMIT statement has the following format:
[EXEC SQL] COMMIT [WORK]
Note:  The optional keyword WORK is included for compliance with the ISO and ANSI standards for SQL.
The COMMIT statement terminates the current transaction. Once committed, the transaction cannot be aborted, and all changes it made become visible to all users through any statement that manipulates that data.
Note:  If READLOCK=NOLOCK is set, the effect of the transaction is visible before it is committed. This is also true when the transaction isolation level is set to read uncommitted.
The COMMIT statement can be used inside a database procedure if the procedure is executed directly, using the execute procedure statement. However, database procedures that are invoked by a rule cannot issue a COMMIT statement: the commit prematurely terminates the transaction that fired the rule. If a database procedure invoked by a rule issues a COMMIT statement, the DBMS Server returns a runtime error. Similarly a database procedure called from another database procedure must not issue a COMMIT because that leaves the calling procedure outside the scope of a transaction.
Note:  This statement has additional considerations when used in a distributed environment. For more information, see the Star User Guide.
Last modified date: 04/03/2024