ALLBASE/SQL Reference Manual (36216-90216)

426 Chapter11
SQL Statements E - R
FETCH
Parameters — non-BULK HostVariableSpecification
HostVariable
identifies the host variable corresponding to one column in the row
fetched.
Indicator
names the indicator variable, an output host variable whose value depends
on whether the host variable contains a null value. The following integer
values are valid:
0 meaning the column's value is not null
1 meaning the column's value is null
>0 meaning the column's value is truncated (for CHAR,
VARCHAR, BINARY, and VARBINARY columns)
Description
This statement cannot be used interactively.
When using this statement to access LONG columns, the name of the file is returned in
the appropriate field in the host variable declaration parameter, SQLDA, or area name
parameter specified. If the output mode is specified with $, then each LONG column in
each row accessed is stored in a file with a unique name.
The use of a descriptor area implies a multiple row result set. You cannot use the BULK
keyword if you employ the DESCRIPTOR identifier.
For a procedure cursor that returns results of a single format, if the procedure was
created with the WITH RESULT clause, since all result sets have the same format, it is
not necessary to issue an ADVANCE statement to advance from one result set to the next.
No end of result set condition is generated on a FETCH statement until all result sets
have been fetched. When the end of a result set has been reached, the next FETCH
statement issued causes procedure execution to continue either until the next result set
is encountered and the first row of the next result set is returned or until procedure
execution terminates.
The USING clause is not allowed within a procedure.
The BULK option is not allowed within a procedure.
Authorization
You do not need authorization to use the FETCH statement.