background image
<< Controlling Transactions | Using the SAVEPOINT Statement >>
<< Controlling Transactions | Using the SAVEPOINT Statement >>

Rolling Back Transaction Changes

Controlling Transactions
Querying and Manipulating Data 2-31
Rolling Back Transaction Changes
The
ROLLBACK
statement rolls back all of the transactions you have made since the
last
COMMIT
statement. If you do not have a preceding
COMMIT
statement in your
program, it rolls back all operations.
Example 2­52
and
Example 2­53
show how to use the
ROLLBACK
statement to undo
changes to the
regions
table.
Example 2­52 Changing the REGIONS Table
UPDATE regions
SET region_name = 'Just Middle East'
WHERE region_name = 'Middle East and Africa';
The results of the query appear.
1 row updated.
Manually check the contents of the
regions
table.
You will see that it now has the updated
region_name
value.
Example 2­53 Performing a ROLLBACK on the Change to the REGIONS Table
ROLLBACK;
Manually check the contents of the
regions
table by clicking the Refresh icon. You
will see that the
region_name
value is changed back to the original value.
See Also:
Oracle Database SQL Language Reference