Oracle8i SQL Reference Release 3 (8.1.7) Part Number A85397-01 |
|
SQL Statements:
DROP SEQUENCE to UPDATE, 20 of 27
Use the SAVEPOINT
statement to identify a point in a transaction to which you can later roll back.
See Also:
|
None.
savepoint
Specify the name of the savepoint to be created.
Savepoint names must be distinct within a given transaction. If you create a second savepoint with the same identifier as an earlier savepoint, the earlier savepoint is erased. After a savepoint has been created, you can either continue processing, commit your work, roll back the entire transaction, or roll back to the savepoint.
To update blake
's and clark
's salary, check that the total company salary does not exceed 27,000, then reenter clark's salary, enter:
UPDATE emp SET sal = 2000 WHERE ename = 'BLAKE'; SAVEPOINT blake_sal; UPDATE emp SET sal = 1500 WHERE ename = 'CLARK'; SAVEPOINT clark_sal; SELECT SUM(sal) FROM emp; ROLLBACK TO SAVEPOINT blake_sal; UPDATE emp SET sal = 1200 WHERE ename = 'CLARK'; COMMIT;
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|