ALLBASE/SQL Reference Manual (36216-90216)

Chapter 12 497
SQL Statements S - Z
SAVEPOINT
12 SQL Statements S - Z
Chapters 10, 11 and 12 describe all the SQL statements in alphabetical order, giving
syntax, parameters, descriptions, authorization requirements, and examples for each
statement. Examples often consist of groups of statements so you can see how each
statement is related to other statements functionally.
SAVEPOINT
The SAVEPOINT statement defines a savepoint within a transaction. DBEnvironment
changes made after a savepoint can be undone at any time prior to the end of the
transaction. A transaction can have multiple savepoints.
Scope
ISQL or Application Programs
SQL Syntax
SAVEPOINT [:
HostVariable
:
LocalVariable
:
ProcedureParameter
]
Parameters
HostVariable
identifies an output host variable used to communicate the savepoint
number. The host variable's value can be from 1 to (2
31
)1. In an
application program, you must use a host variable with the SAVEPOINT
statement. In a procedure, you must use either a local variable or a
procedure parameter with the SAVEPOINT statement.
When you enter a SAVEPOINT statement interactively, you cannot specify a
host variable. ISQL assigns and displays the savepoint number as follows:
isql=> savepoint;
Savepoint number is
n
.
Use this number to do ROLLBACK WORK to
n
.
LocalVariable
contains a value in a procedure. Identifies an output host variable used
to communicate the savepoint number. The host variable's value can be
from 1 to (2
31
)1.
ProcedureParameter
contains a value that is passed into or out of a procedure.
Identifies an output host variable used to communicate the savepoint
number. The host variable's value can be from 1 to (2
31
)1.