SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)

Dynamic SQL Rowsets
HP NonStop SQL/MX Programming Manual for C and COBOL523627-004
12-6
Setting the Rowset-Specific Descriptor Fields
set-descriptor-info is:
COUNT = value-specification
| ROWSET_SIZE = value-specification
| VALUE item-number set-item-info [, set-item-info]...
set-item-info is:
descriptor-item-name = value-specification
descriptor-item-name is:
ROWSET_VAR_LAYOUT_SIZE
| ROWSET_IND_LAYOUT_SIZE
| other-descriptor-item-names
The value-specification can be a literal or a host variable with exact numeric
data type. For the full description of the SET DESCRIPTOR statement, including the
other-descriptor-item-names, see the SQL/MX Reference Manual.
ROWSET_SIZE
Use the ROWSET_SIZE descriptor field header to specify the number of rows to be
transmitted to and from a database while executing SQL statements. For input
descriptors, this field must contain the value N as described in Specification of an
Rowset Parameter in the PREPARE String on page 12-3. For output descriptors, this
field must contain the common length (for example, M) of all rowset output variables
that you will use to retrieve data from the dynamic SQL cursor. Multiple FETCH
statements can be issued on a cursor, and the value of ROWSET_SIZE can be
different for each FETCH call. This value is equal to the maximum number of rows that
will be retrieved by the FETCH statement.
This field occurs only once per descriptor regardless of how many individual items
might be contained in that descriptor. A descriptor does not contain a field to store the
size of each individual rowset host variable used to transfer data. Instead, a descriptor
contains one field to store the common rowset size for all input or output arrays. For
input descriptors, this value denotes N, the number of times the SQL statement is
logically executed with separate scalar input value sets. However, if there is a
ROWSET FOR INPUT SIZE clause in the SQL statement, the value provided for the
INPUT SIZE must be less than or equal to N, and the statement is only logically
executed INPUT SIZE number of times.
For input descriptors, DESCRIBE can be used to set the value of this field to N. For
output descriptors, set this field manually.
ROWSET_VAR_LAYOUT_SIZE
Use the ROWSET_VAR_LAYOUT_SIZE item field in a descriptor to specify the size of
an individual array element in a rowset host variable. A value 0 (zero) in this field
denotes that the host variable is not of rowset type and is a scalar host variable. For
rowset host variables, this field is equal to the size of an individual array element. If you