COMMIT

Purpose

Use this statement to persistently store changes of the current transaction in the database.

Prerequisite

None

Syntax

commit::=

commit statement

Usage Notes

  • The keyword WORK is optional and is only supported to conform to the SQL standard.
  • The automatic running of COMMIT after each SQL statement is possible with the client setting "autocommit". For example, in EXAplus with SET AUTOCOMMIT ON/OFF, or in DB Visualizer @set autocommit on/off.

For more information on transactions, see Transaction Management.

Examples

CREATE TABLE t (i DECIMAL);
INSERT INTO t values (1);
COMMIT;
SELECT COUNT(*) FROM t;
-- table's data was already persistently committed
ROLLBACK;
SELECT COUNT(*) FROM t;