A savepoint is a point in a transaction. You can use rollback to return to a storage point. A transaction can have multiple storage points. Once the transaction is committed, save
A savepoint is a point in a transaction. You can use rollback to return to a storage point. A transaction can have multiple storage points. Once the transaction is committed, save
I. Basic Concepts
A savepoint is a point in a transaction. You can use rollback to return to a storage point. A transaction can have multiple storage points. Once the transaction is committed, the storage points in the transaction will be automatically deleted, no matter how many storage points have been done.
SQL> savepoint sp;
Savepoint created
SQL> delete from mytable;
15 rows deleted
SQL> rollback to sp;
Rollback complete
SQL> select count (*) from mytable;
COUNT (*)
----------
15
The delete operation is rolled back.
Ii. Details
Several important transactions
1. Set savepoint.
2. Cancel partial transaction rollback to
3. Cancel all transaction rollback
If you execute the SQL> commit; commit operation, all the storage points in the transaction do not exist. If you do not manually execute commit but exit, it is automatically submitted.
Refer to the video "Go Oracle" from Han shunping.