Valid in: ESQL
The Describe input statement returns information about the input parameter markers of a prepared statement. (Input parameter markers are denoted by "?" in the prepared statement.)
When there is a direct correspondence to a table column, such as positional mapping or direct comparison, the type of the table column is returned. Otherwise, a best guess of the type based on local context (such as the nearest resolvable operand) is returned.
Note: Best-guess types are typically returned as nullable. If no type guess is possible because of lack of context, a zero (illegal) type is returned, but the describe input operation succeeds.
The Describe Input statement has the following format:
EXEC SQL DESCRIBE INPUT statement_name
USING [SQL] DESCRIPTOR :descriptor_name
[WITHOUT NESTING]
Specifies a valid prepared statement. Specify the statement_name using a string literal or a host language string variable. If the statement is prepared but has no input parameters, the describe input succeeds and returns zero for the returned SQLDA's sqld field.
Identifies the name of the receiving descriptor area, formatted as an SQLDA. The descriptor name can be SQLDA or any other valid object name defined by the program when the structure is allocated. Because the SQLDA is not declared in a declaration section, the preprocessor does not verify that descriptor_name represents an SQLDA structure. If descriptor_name does not represent an SQLDA structure, undefined errors occur at runtime. For information about the structure of an SQLDA and its allocation and inclusion in an embedded program, see the Embedded SQL Companion Guide.
This optional noise phrase is included for Standards conformance. It has no effect on the operation of the statement.
The describe input statement cannot be issued until after the program allocates the SQLDA and sets the value of the SQLDA's sqln field to the number of elements in the SQLDA's sqlvar array. The results of the describe input statement are complete and valid only if the number of the statement parameter markers is less than or equal to the number of allocated sqlvar elements.