ROLLBACK
Use the ROLLBACK
statement to undo work done in the current transaction.
Required privilege
None
Usage with TimesTen Scaleout
This statement is supported with TimesTen Scaleout.
SQL syntax
ROLLBACK [WORK]
Parameters
The ROLLBACK
statement enables the following optional keyword:
Parameter | Description |
---|---|
|
Optional clause supported for compliance with the SQL standard. |
Description
When the PassThrough
connection attribute is specified with a value greater than zero, the Oracle database transaction will also be rolled back.
A rollback closes all open cursors.
Examples
Insert a row into the regions
table of the HR
schema and then roll back the transaction. First set AUTOCOMMIT
to 0:
Command> SET AUTOCOMMIT 0; Command> INSERT INTO regions VALUES (5,'Australia'); 1 row inserted. Command> SELECT * FROM regions; < 1, Europe > < 2, Americas > < 3, Asia > < 4, Middle East and Africa > < 5, Australia > 5 rows found. Command> ROLLBACK; Command> SELECT * FROM regions; < 1, Europe > < 2, Americas > < 3, Asia > < 4, Middle East and Africa > 4 rows found.
See also