Oracle® Database PL/SQL User's Guide and Reference 10g Release 2 (10.2) Part Number B14261-01 |
|
|
PDF · Mobi · ePub |
The COMMIT
statement makes permanent any changes made to the database during the current transaction. A commit also makes the changes visible to other users. For more information on PL/SQL transaction processing, see "Overview of Transaction Processing in PL/SQL".
The SQL COMMIT
statement can be embedded as static SQL in PL/SQL. For syntax details on the SQL COMMIT
statement, see the Oracle Database SQL Reference. See also "Committing Transactions" in Oracle Database Application Developer's Guide - Fundamentals and the COMMIT_WRITE
initialization parameter in Oracle Database Reference.
The COMMIT
statement releases all row and table locks, and erases any savepoints you marked since the last commit or rollback. Until your changes are committed:
You can see the changes when you query the tables you modified, but other users cannot see the changes.
If you change your mind or need to correct a mistake, you can use the ROLLBACK
statement to roll back (undo) the changes.
If you commit while a FOR
UPDATE
cursor is open, a subsequent fetch on that cursor raises an exception. The cursor remains open, so you should still close it. For more information, see "Using FOR UPDATE".
For examples, see the following: