AntDB-Oracle Compatibility Developer’s Manual P3–20
AntDB
Posted on September 5, 2023
ROLLBACK
Name
ROLLBACK -- interrupt the current transaction
Summary
ROLLBACK
Description
The ROLLBACK command rolls back the current transaction and aborts all update operations performed by the transaction.
argument
WORK
Optional keyword - has no effect in practice.
Note
A transaction can be successfully terminated using the COMMIT command.
Executing the ROLLBACK command outside of a transaction does not cause side effects.
Example
Abort all data change operations:
ROLLBACK;
ROLLBACK TO SAVEPOINT
Name
ROLLBACK TO SAVEPOINT -- roll back the transaction to a save point
Summary
ROLLBACK TO [ SAVEPOINT ] savepoint_name
Description
Rollback of all commands executed after the savepoint was created. Savepoints remain valid and can be used again for rollback if desired. After naming a savepoint, the ROLLBACK TO SAVEPOINT command removes all previously created savepoints in an implicit state.
argument
savepoint_name
The name of the savepoint to roll back to.
Note
Specifying a savepoint name that has not been created will generate an error.
The ROLLBACK TO SAVEPOINT command is not supported inside the SPL program.
Example
Undo the operation of the command following the save point depts.
INSERT INTO dept VALUES (50, 'HR', 'NEW YORK');
SAVEPOINT depts;
INSERT INTO emp (empno, ename, deptno) VALUES (9001, 'JONES', 50);
INSERT INTO emp (empno, ename, deptno) VALUES (9002, 'ALICE', 50);
ROLLBACK TO SAVEPOINT depts;
Posted on September 5, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.