ROLLBACK SQL statement
Description
Cancels all database operations in the specified database
since the last COMMIT, ROLLBACK,
or CONNECT.
Using COMMIT and ROLLBACK ina server component
COMMIT and ROLLBACK commands
embedded in a server component might have different effects depending
on the setting of the UseContextObject DBParm parameter.
For information on the UseContextObject parameter
see Connecting to Your Database. For information
on deploying components to a transaction server, see Application
Techniques.
Syntax
|
1 |
ROLLBACK {USING <span>TransactionObject</span>} ; |
|
Parameter |
Description |
|---|---|
|
TransactionObject |
The name of the transaction object that |
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
This statement cancels all database operations in the database specified
in the default transaction object:
|
1 |
ROLLBACK ; |
This statement cancels all database operations in the database specified
in the transaction object named Emp_tran:
|
1 |
ROLLBACK USING emp_tran ; |