ROLLBACK
SQL statement
Description
Cancels all database operations in the specified database since
the last COMMIT, ROLLBACK, or CONNECT.
Syntax
1 |
ROLLBACK {USING TransactionObject} ; |
Parameter |
Description |
---|---|
TransactionObject |
The name of the transaction object that identifies |
Usage
ROLLBACK does not cause a disconnect, but it does close all open
cursors and procedures.
Error handling
It is good practice to test the success/failure code after
executing a ROLLBACK statement.
Examples
Example 1
This statement cancels all database operations in the database
specified in the default transaction object:
1 |
ROLLBACK ; |
Example 2
This statement cancels all database operations in the database
specified in the transaction object named Emp_tran:
1 |
ROLLBACK USING emp_tran ; |