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

HP NonStop SQL/MX Programming Manual for C and COBOL523627-004
12-1
12 Dynamic SQL Rowsets
The dynamic SQL statements of NonStop SQL/MX can use rowsets to:
Provide an array of input values in an INSERT, UPDATE, DELETE, or SELECT
statement.
Retrieve an array of output values in a FETCH statement.
This section describes:
Using Dynamic SQL Rowsets on page 12-1
Preparing an SQL Statement With Dynamic Rowsets on page 12-2
Using the SET DESCRIPTOR Statement on page 12-5
Using the GET DESCRIPTOR Statement on page 12-9
Using the DESCRIBE INPUT Statement on page 12-10
For a general discussion of rowsets, see Section 7, Static Rowsets.
Using Dynamic SQL Rowsets
You can use of rowsets in dynamic SQL statements as you do rowsets in static SQL
statements, with these restrictions:
Rowset-derived tables are not available from dynamic SQL.
In dynamic SQL, all input rowsets must be of the same size in an SQL statement.
Use of rowsets and scalars for input in the same SQL statement is allowed, as in
static SQL, but all rowsets for input must be of the same size in a dynamic SQL
statement.
The dynamic SQL programming model is described in:
Section 9, Dynamic SQL
Section 10, Dynamic SQL With Descriptor Areas
Section 11, Dynamic SQL Cursors
To use rowsets in a dynamic SQL statement follow all guidelines described in these
sections with these restrictions:
For a C/C++ application, when dynamic SQL rowsets are used with descriptor
areas, data must be exchanged with NonStop SQL/MX using the
VARIABLE_POINTER and INDICATOR_POINTER descriptor fields. You cannot
use the VARIABLE_DATA and INDICATOR_DATA descriptor fields with dynamic
SQL rowsets.
For a COBOL application, dynamic SQL rowsets with descriptor areas because the
VARIABLE_POINTER descriptor field is not supported in COBOL. Dynamic SQL
rowsets in COBOL can be accessed only by using dynamic SQL with argument
lists, as described in Steps for Using Dynamic SQL With Argument Lists
on
page 9-3.