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.
exec sql describe input statement_name using sql descriptor descriptor_name;
The name of the prepared statement about which you want information. statement_name must identify a prepared statement.
Identifies descriptor_name as a SQL descriptor.
The name of the SQL descriptor that can store information about the dynamic parameter markers in the prepared statement.
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++)
Information about the statement is written into the descriptor provided in the using clause. Use the get descriptor statement after executing the describe input statement to extract information from the descriptor into host variables.
The descriptor must be allocated before the describe input statement can be executed.
allocate descriptor, deallocate descriptor, describe output, get descriptor, prepare, set descriptor