7.5.25 ROLLBACK

Table of Contents Previous Next



7.5.25 ROLLBACK
Use the ROLLBACK statement to abort the current transaction, and discard any updates made by the transaction. The syntax is:
EXEC SQL [AT database_name] ROLLBACK [WORK]
[ { TO [SAVEPOINT]
savepoint } | RELEASE ]
database_name is the database identifier or a host variable that contains the database identifier against which the statement will execute. If you omit the AT clause, the statement will execute against the current default database.
Include the TO clause to abort any commands that were executed after the specified savepoint; use the SAVEPOINT statement to define the savepoint. If you omit the TO clause, the ROLLBACK statement will abort the transaction, discarding all updates.
Include the RELEASE clause to cause the application to execute an EXEC SQL COMMIT RELEASE and close the connection.
Only the portion of the transaction that occurred after the my_savepoint is rolled back; my_savepoint is retained, but any savepoints created after my_savepoint will be erased.


Table of Contents Previous Next