DESCRIBE INPUT statement
Use the DESCRIBE INPUT statement to return input parameter information before a prepared statement is executed.
Use this statement with ESQL/C.
Syntax
(explicit id desi001)
desi001
DESCRIBE INPUT
{
statement_var
| statement_id
}
{ USINGSQL DESCRIPTOR
{
'descriptor'
| descriptor_var
}
| INTO
{ SQL DESCRIPTOR
{
'descriptor'
| descriptor_var
}
| []sqlda_pointer
}
}
Element | Description | Restrictions | Syntax |
---|---|---|---|
descriptor | Name of a system-descriptor area | System-descriptor area must already be allocated | Quoted String |
descriptor_var | Host variable specifying a system-descriptor area | Must contain the name of an allocated system-descriptor area | Language-specific rules for names |
sqlda_pointer | Pointer to an sqlda structure | Cannot begin with dollar ( $ ) sign or colon ( : ). An sqlda structure is required if dynamic SQL is used. | See the sqlda structure in the Informix® ESQL/C Programmer's Manual. |
statement_id | Statement identifier for a prepared SQL statement | Must be defined in a previously executed PREPARE statement | PREPARE statement; PREPARE statement; Identifier |
statement_var | Host variable that contains the value of statement_id | Variable and statement_id both must be declared | Language-specific rules for names |
Usage
The DESCRIBE INPUT
and the DESCRIBE OUTPUT statements can return information about a
prepared statement to an SQL Descriptor Area (sqlda):
- For a SELECT, EXECUTE FUNCTION (or PROCEDURE), INSERT, or UPDATE statement, the DESCRIBE statement (with no INPUT keyword) returns the number, data types, and size of the returned values, and the name of the column or expression.
- For a SELECT, EXECUTE FUNCTION, EXECUTE PROCEDURE, DELETE, INSERT, or UPDATE statement, the DESCRIBE INPUT statement returns all the input parameters of a prepared statement.
Tip: Informix® versions
earlier than 9.40 do not support the INPUT keyword. For compatibility
with legacy applications, DESCRIBE without INPUT is
supported. In new applications, you should use DESCRIBE INPUT statements
to provide information about dynamic parameters in the WHERE clause,
in subqueries, and in other syntactic contexts where the old form
of DESCRIBE cannot provide information.
With this information, you can write code to allocate memory to hold retrieved values that you can display or process after they are fetched.
The IFX_UPDDESC environment variable does not need to be set before you can use DESCRIBE INPUT to obtain information about an UPDATE statement.
1 Informix® extension