SAVEPOINT — define a new savepoint within the current transaction


SAVEPOINT savepoint_name


SAVEPOINT establishes a new savepoint within the current transaction.
A savepoint identifies a point in a transaction that all commands, executed after the savepoint was established, to be rolled back, thereby restoring the transaction state to the original state. There can be multiple savepoints defined within a transaction.
Use COMMIT to release all savepoints and commit all database changes for the current transaction (See COMMIT).
Use ROLLBACK TO SAVEPOINT to rollback to a previously specific savepoint within the current transaction (See ROLLBACK). Use ROLLBACK to rollback all changes for the current transaction, regardless of savepoints in the current transaction.
Use RELEASE SAVEPOINT to destroy a savepoint.

Note: AUTOCOMMIT must be OFF to enable transaction savepoints.