Your browser does not support JavaScript. This help page requires JavaScript to render correctly. Committing Transactions
Skip Headers
Previous
Previous
 
Next
Next

Committing Transactions

Committing a transaction makes its changes permanent, erases its savepoints, and releases its locks.

To explicitly commit a transaction, use either the COMMIT statement or (in the SQL Developer environment) the Commit Changes icon.

Note: Oracle Database issues an implicit COMMIT statement before and after any data definition language (DDL) statement. For information about DDL statements, see "About Data Definition Language (DDL) Statements".

Before you commit a transaction:

After you commit a transaction:

The following example adds one row to the REGIONS table (a very simple transaction), checks the result, and then commits the transaction.

Committing a Transaction

Before transaction:

SELECT * FROM REGIONS
ORDER BY REGION_ID;
 

Result:

 REGION_ID REGION_NAME
---------- -------------------------
         1 Europe
         2 Americas
         3 Asia
         4 Middle East and Africa
 

Transaction (add row to table):

INSERT INTO regions (region_id, region_name) VALUES (5, 'Africa');
 

Result:

1 row created.
 

Check that row was added:

SELECT * FROM REGIONS
ORDER BY REGION_ID;
 

Result:

 REGION_ID REGION_NAME
---------- -------------------------
         1 Europe
         2 Americas
         3 Asia
         4 Middle East and Africa
         5 Africa

Commit transaction:

COMMIT;

Result:

Commit complete.

Related Topics

Oracle Database SQL Language Reference

About DML Statements and Transactions