COMMIT

COMMIT — commit the current transaction

Syntax

COMMIT [ WORK ]

Description

COMMIT commits the current transaction. All changes made by the transaction become visible to others and are guaranteed to be durable even if an unexpected termination in service occurs.

If a transaction fails to commit due to a system error, then the transaction is left in a failed state. If a client tries to execute a new statement in that transaction, then an error is returned, and you must roll back the failed transaction.

Parameters

WORK

An optional keyword that has no effect.

Example

SET AUTOCOMMIT OFF;
CREATE TABLE tab1 (column1 STRING);
INSERT INTO tab1 VALUES ('row1');
COMMIT;          /* Use ROLLBACK instead to rollback the transaction */
SET AUTOCOMMIT ON;