You are here: Reference Information > SQL Reference Information > SQL Statements > COMMIT

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 if an unexpected termination in service occurs.
Use ROLLBACK to stop and undo a transaction (see ROLLBACK). You can rollback to a savepoint, but you cannot commit a savepoint. A COMMIT implicitly releases all named savepoints. See SAVEPOINT for more information.

Caution: If a transaction fails on commit due to a system error, it is left in a failed state. If a client tries to execute a new statement in that transaction, an error is returned.

Parameters

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;