PL/SQL User's Guide and Reference Release 2 (9.2) Part Number A96624-01 |
|
PL/SQL Language Elements, 42 of 52
The ROLLBACK
statement is the inverse of the COMMIT
statement. It undoes some or all database changes made during the current transaction. For more information, see "Overview of Transaction Processing in PL/SQL".
When a parameterless ROLLBACK
statement is executed, all database changes made during the current transaction are undone.
This statement undoes all database changes (and releases all locks acquired) since the savepoint identified by savepoint_name
was marked.
This keyword is optional and has no effect except to improve readability.
This is an undeclared identifier, which marks the current point in the processing of a transaction. For naming conventions, see "Identifiers".
This keyword is optional and has no effect except to improve readability.
All savepoints marked after the savepoint to which you roll back are erased. However, the savepoint to which you roll back is not erased. For example, if you mark savepoints A, B, C, and D in that order, then roll back to savepoint B, only savepoints C and D are erased.
An implicit savepoint is marked before executing an INSERT
, UPDATE
, or DELETE
statement. If the statement fails, a rollback to the implicit savepoint is done. Normally, just the failed SQL statement is rolled back, not the whole transaction. However, if the statement raises an unhandled exception, the host environment determines what is rolled back.
In SQL, the FORCE
clause manually rolls back an in-doubt distributed transaction. However, PL/SQL does not support this clause. For example, the following statement is not allowed:
ROLLBACK WORK FORCE '24.37.85'; -- not allowed
In embedded SQL, the RELEASE
option frees all Oracle resources (locks and cursors) held by a program and disconnects from the database. However, PL/SQL does not support this option. For example, the following statement is not allowed:
ROLLBACK WORK RELEASE; -- not allowed
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|