Savepoint of transactions in Oracle

Source: Internet
Author: User
Tags savepoint
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.