AntDB-Oracle Compatibility Developer’s Manual P3–20

antdbanhui

AntDB

Posted on September 5, 2023

AntDB-Oracle Compatibility Developer’s Manual P3–20

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;
Enter fullscreen mode Exit fullscreen mode

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;
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
antdbanhui
AntDB

Posted on September 5, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024

Modern C++ for LeetCode 🧑‍💻🚀
leetcode Modern C++ for LeetCode 🧑‍💻🚀

November 29, 2024