Firebird Documentation Index → Firebird 2.5 Language Ref. Update → Transaction control statements → ROLLBACK |
Table of Contents
Find a more recent version at Firebird 5.0 Language Reference: ROLLBACK
Available in: DSQL, ESQL
Syntax:
ROLLBACK [WORK] [TRANSACTIONtr_name
] [RETAIN [SNAPSHOT] | TO [SAVEPOINT]sp_name
| RELEASE]
The TRANSACTION clause is only available in ESQL.
The RELEASE clause is only available in ESQL, and is discouraged.
RETAIN and TO are only available in DSQL.
Available in: DSQL
Added in: 2.0
Description: Undoes all the database changes carried out in the transaction without closing it. User variables set with RDB$SET_CONTEXT() remain unchanged.
Syntax:
ROLLBACK [WORK] RETAIN [SNAPSHOT]
The functionality provided by ROLLBACK RETAIN has been present
since InterBase 6, but the only way to access it was through the API call
isc_rollback_retaining()
.
Available in: DSQL
Added in: 1.5
Description: Undoes everything that happened in a transaction since the creation of the savepoint.
Syntax:
ROLLBACK [WORK] TO [SAVEPOINT]name
ROLLBACK TO SAVEPOINT performs the following operations:
All the database mutations performed within the transaction since the savepoint was created are undone. User variables set with RDB$SET_CONTEXT() remain unchanged.
All savepoints created after the one named are destroyed. All earlier savepoints are preserved, as is the savepoint itself. This means that you can rollback to the same savepoint several times.
All implicit and explicit record locks acquired since the savepoint are released. Other transactions that have requested access to rows locked after the savepoint must continue to wait until the transaction is committed or rolled back. Other transactions that have not already requested the rows can request and access the unlocked rows immediately.
For a full discussion of savepoints, see SAVEPOINT.
Firebird Documentation Index → Firebird 2.5 Language Ref. Update → Transaction control statements → ROLLBACK |