COMMIT
The COMMIT
statement ends the current transaction and makes permanent all changes performed in the transaction.
Required privilege
None
Usage with TimesTen Scaleout
This statement is supported with TimesTen Scaleout.
SQL syntax
COMMIT [WORK]
Parameters
The COMMIT
statement enables the following optional keyword:
Parameter | Description |
---|---|
|
Optional clause supported for compliance with the SQL standard. |
Description
-
Until you commit a transaction:
-
You can see any changes you have made during the transaction but other users cannot see the changes. After you commit the transaction, the changes are visible to other users' statements that execute after the commit.
-
You can roll back (undo) changes made during the transaction with the
ROLLBACK
statement.
-
-
This statement releases transaction locks.
-
For passthrough, the Oracle Database transaction will also be committed.
-
A commit closes all open cursors.
Examples
Insert a row into regions
table of the HR
schema and commit transaction. First set autocommit to 0:
Command> SET AUTOCOMMIT 0; Command> INSERT INTO regions VALUES (5,'Australia'); 1 row inserted. Command> COMMIT; Command> SELECT * FROM regions; < 1, Europe > < 2, Americas > < 3, Asia > < 4, Middle East and Africa > < 5, Australia > 5 rows found.
See also