What is Save-Points in SQLite !!!

SQLite also support save-point.

Savepoints allow you to mark specific points in the transaction. You can then accept or rollback to individual save-points without having to commit or rollback an entire transaction. Unlike transactions, you can have more than one save-point active at the same time.

Save-points are sometime called nested transaction.

You can create a save-point with the SAVEPOINT command.

Command : SAVEPOINT savepoint_name

Save-points act as a stack. Whenever you create a new one, it is put at the top of the stack. Save-point identifiers do not need to be unique. If the same save-point identifier is used more than once, the one nearest to the top of the stack is used.

To release a save-point and accept all of the proposed changes made since the savepoint was set, use the

RELEASE command:

RELEASE [SAVEPOINT] savepoint_name

To cancel a set of commands and undo everything back to where a save-point was set, use the ROLLBACK TO command:
ROLLBACK [TRANSACTION] TO [SAVEPOINT] savepoint_name

tips & tricks

Join 7,719 other subscribers

interview questions


Algorithm Android Android Studio API APP Programming Apps blogging Browser CheatSheets Code Config CSS DATABASE dsa error Features HTML HTML5 IDE installation Interview Questions IOS iPhone javascript Mac objective-c OneDrive OS Placeholder Programming quicktips SDK SEO Settings SMO SQL swift swiftUI Teams Tips & Tricks Tools UI Web Wordpress Xcode


Archives

Leave a Reply

Your email address will not be published. Required fields are marked *

Discover more from CODE t!ps

Subscribe now to keep reading and get access to the full archive.

Continue reading