describe input (SQL descriptor)

Description

Obtains information about dynamic parameter markers in a prepared dynamic SQL statement and stores that information in a SQL descriptor.

For a list of possible SQL descriptor datatype codes, see Table 10-5.

Syntax

exec sql describe input statement_name 
 using sql descriptor descriptor_name;

Parameters

statement_name

The name of the prepared statement about which you want information. statement_name must identify a prepared statement.

sql descriptor

Identifies descriptor_name as a SQL descriptor.

descriptor_name

The name of the SQL descriptor that can store information about the dynamic parameter markers in the prepared statement.

Examples

Example 1

exec sql begin declare section;
char           query[maxstmt];
int            nin, nout, i;
exec sql end declare section;
int    j;
                 ...
exec sql allocate descriptor din with max 256;
exec sql allocate descriptor dout with max 256;
exec sql whenever sqlerror stop;
exec sql prepare dynstmt from :query;
exec sql describe input dynstmt
    using sql descriptor din;
exec sql get descriptor din :nin = count;
for (i = 0; i < nin; i++)

Usage

See also

allocate descriptor, deallocate descriptor, describe output, get descriptor, prepare, set descriptor