describe output (SQLDA)

Description

Obtains row format information about the result set of a prepared dynamic SQL statement and stores that information in a SQLDA structure.

Syntax

exec sql describe [output] statement_name 
 using descriptor sqlda_name;

Parameters

output

An optional keyword that has no effect on the describe output statement but provides conformance to the SQL standard.

statement_name

The name (specified in a prepare statement) that represents the select statement to be executed.

descriptor

Identifies sqlda_name as a SQLDA structure.

sqlda_name

The name of a SQLDA structure that will store the information returned by the describe output statement.

Examples

Example 1

...
exec sql open curs2 using descriptor input_descriptor;
exec sql describe output statement using descriptor
     output_descriptor;
output_descriptor->sqlda_column->sqlda_sqldata = character;
output_descriptor->sqlda_column->sqlda_datafmt.datatype =     CS_CHAR_TYPE;
output_descriptor->sqlda_column->sqlda_datafmt.maxlength = 20;
output_descriptor->sqlda_column->sqlda_sqllen = 20;
output_descriptor->sqlda_column->sqlda_datafmt.format = 
     (CS_FMT_NULLTERM | CS_FMT_PADBLANK);
exec sql fetch curs2 into descriptor output_descriptor;

Usage

See also

describe input, execute, prepare