ALLBASE/SQL Reference Manual (36216-90216)

Chapter 11 465
SQL Statements E - R
OPEN
HostVariableName
specifies a host variable name that at run time contains the data
value that is assigned to an input dynamic parameter specified in the
parameter list of a prepared SELECT or EXECUTE PROCEDURE statement.
Host variables must be specified in the same order as the dynamic
parameters in the prepared statement they represent. There must be a
one to one correspondence between host variable names and the dynamic
parameters. A maximum of 1023 host variables names can be specified.
IndicatorVariable
names an indicator variable, whose value determines whether the
associated host variable contains a NULL value:
> = 0 the value is not NULL
< 0 the value is NULL
Description
For a select cursor, ALLBASE/SQL examines any input host variables and input
dynamic parameters used in the cursor definition, determines the cursor's active set,
positions the cursor before the first row of the active set, and leaves the cursor in the
open state. No rows are actually available to your application program until a FETCH
statement is executed.
For a procedure cursor, ALLBASE/SQL examines any input host variables and input
dynamic parameters used in the cursor definition. No rows are actually available to
your application program, nor does procedure execution begin, until ADVANCE and/or
FETCH statements are executed.
For a select cursor, the KEEP CURSOR option lets you maintain the cursor position in
an active set beyond transaction boundaries. When you use this option, the COMMIT
WORK and ROLLBACK WORK statements do not automatically close the cursor. Instead,
you must explicitly close the cursor and then issue a COMMIT WORK.
Cursors not using the KEEP CURSOR option are automatically closed when a
transaction terminates or a ROLLBACK WORK TO SAVEPOINT is executed.