Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete Savepoint in ORACLE server

I understand that a savepoint in Oracle SQL identifies a point in a transaction to which you can later rollback.

So technically if I create a savepoint now and performs 100 manipulations on the DB, I can rollback to before those 100 manipulations.

But what if now I don't want to track my changes and delete the savepoint?

thanks

like image 345
Crash Bandicoot Avatar asked Dec 06 '25 05:12

Crash Bandicoot


1 Answers

As commented by a_horse_with_no_name, there is no syntax in Oracle to delete a savepoint.

When you COMMIT or a ROLLBACK the transaction, the savepoints are automatically deleted.

From the Oracle docs on Transaction Control :

The COMMIT statement ends the current transaction and makes all changes performed in the transaction permanent. COMMIT also erases all savepoints in the transaction and releases transaction locks.

The ROLLBACK statement reverses the work done in the current transaction; it causes all data changes since the last COMMIT or ROLLBACK to be discarded.

You may also want to modify your code to not create savepoints.

like image 180
GMB Avatar answered Dec 08 '25 20:12

GMB



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!