SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-177
SELECT Statement
ROWSET FOR size-and-index
Allowed only if you use rowsets in the SELECT statement. INPUT SIZE
rowset-size-in and KEY BY row-id are allowed only if you specify
rowset-search-condition in the where clause. OUTPUT SIZE
rowset-size-out is allowed only with SELECT … INTO statements where
variable-spec consists of rowset type host variables.
INPUT SIZE rowset-size-in
restricts the size of the input rowset to the specified size, which must be less than
or equal to the allocated size for the rowset. The size is an integer literal (exact
numeric literal), a dynamic parameter, or a host variable whose type is either
unsigned short, signed short, unsigned long, or signed long in C and their
corresponding equivalents in COBOL. If you do not specify the size, NonStop
SQL/MX uses the allocated rowset size specified in the SQL Declare Section of the
embedded SQL program.
OUTPUT SIZE rowset-size-out
restricts the size of the output rowset to the specified size which must be less than
or equal to the allocated size for the rowset. The size is an integer literal (exact
numeric literal) or a host variable whose type is signed long in C and its
corresponding equivalent in COBOL. If you do not specify the size, NonStop
SQL/MX uses the allocated rowset size specified in the SQL Declare Section of the
embedded SQL program. This option is not supported in a cursor declaration.
OUTPUT SIZE is supported only with SELECT ... INTO statements.
KEY BY row-id
is a zero-based index that identifies each row in the result set of a SELECT or
FETCH statement with the particular search-condition in the WHERE clause
that caused the row to be part of the result set. For example, if the row-id value
for a certain row in the result set is 0 (zero), this row matches the search-
condition in the first element of the host variable arrays (array index 0 in C,
array index 1 in COBOL) in the WHERE clause.
For more information about rowsets, see the SQL/MX Programming Manual for C
and COBOL
expression-list is:
expression [,expression]...
transpose-col-list is:
colname | (colname-list)
colname-list is:
colname [,colname]..
Embed