Rollbacks to Savepoints

A ROLLBACK TO SAVEPOINT command undoes all changes after a savepoint.

This command rolls back to the savepoint you specify, or to the most recent savepoint if you do not specify a named savepoint. Rolling back to savepoint n undoes all actions for all savepoints greater than or equal to n.

Normally, locks are released only at the end of a transaction. However, ROLLBACK TO SAVEPOINT does release locks under certain conditions, as in the following scenario:

Assume you have a series of savepoints in a transaction, and you then perform a write operation. Roll back the transaction to an earlier savepoint. The rollback undoes all actions after that savepoint, including the write operation and any locks it acquires after the savepoint you are rolling back to.

SAP Sybase IQ supports savepoint operations on updatable cursors.