You can use a pointer to an sqlda structure to stores output values when you do not know the number of values or their data types that a SELECT or EXECUTE FUNCTION (or EXECUTE PROCEDURE) statement returns.
This structure contains data descriptors that specify the data type and memory location for one selected value. The keywords USING DESCRIPTOR introduce the name of the pointer to the sqlda structure.
The following example shows a FETCH USING DESCRIPTOR statement:
struct sqlda *sqlda_ptr; ... EXEC SQL declare selcurs2 cursor for select * from customer where state = 'CA'; EXEC SQL describe selcurs2 into sqlda_ptr; ... EXEC SQL open selcurs2; while (1) { EXEC SQL fetch selcurs2 using descriptor sqlda_ptr; ...
The sqld value specifies the number of output values that are described in occurrences of the sqlvar structures of the sqlda structure. This number must correspond to the number of values returned from the prepared statement.
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]