Skip Headers
Oracle® Database PL/SQL User's Guide and Reference
10g Release 2 (10.2)

Part Number B14261-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

COMMIT Statement

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.

Usage Notes

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:

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".

Examples

For examples, see the following:


Example 6-1, "Data Manipulation With PL/SQL"
Example 6-3, "Substituting PL/SQL Variables"
Example 6-36, "Using COMMIT With the WRITE Clause"
Example 6-40, "Using SET TRANSACTION to Begin a Read-only Transaction"
Example 6-43, "Declaring an Autonomous Function in a Package"

Related Topics


"ROLLBACK Statement"
"SAVEPOINT Statement"
"Transaction Control"
"Fetching Across Commits"