602SQL Documentation Index  


statement_SAVEPOINT ::= SAVEPOINT savepoint
savepoint ::= identifier | integer_variable

The SAVEPOINT statement creates a savepoint that can be referred to later in the same transaction. This provides the ability to return and undo all modifications done to the database after the savepoint was created.

A savepoint may be specified in one of the following ways:

If the savepoint designated with an identifier or an integer_variable already exists, the SAVEPOINT statement will delete and recreate the savepoint.

If the integer_variable is assigned a value that does not designate any existing savepoint, and is not zero, the error sqlstate 3B001 occurs.

The maximum number of savepoints that can be created by a single client is limited to 1000. When this limit is exceeded, the error sqlstate 3B002 occurs.