SQLDescribeParam

SQLDescribeParam is an ODBC API which returns metadata for the parameters of a query.

In earlier releases of the Informix® ODBC Driver, the SQLDescribeParam API returned SQL_UNKNOWN if the API was called to get information about an expression value or a parameter that was embedded inside another routine. This restriction no longer applies to values of BOOLEAN, LVARCHAR, or of built-in non-opaque Informix® data types that are returned by the following expressions in other UDRs:
  • Binary arithmetic expressions
    • Addition ( + )
    • Subtraction ( - )
    • Multiplication ( * )
    • Division ( / )
  • Relational operator expressions
    • Less than ( < )
    • Less than or equal to ( <= )
    • Equal to ( =, == )
    • Greater than or equal to ( >= )
    • Greater than ( > )
    • Not equal to ( <>, != )
  • The following string operations
    • Concatenation ( || )
    • MATCHES
    • LIKE
  • BETWEEN ... AND conditional expressions
For example, if the column tab1.c1 is an INT data type, SQLDescribeParam() returns type int for the input host variable of the following query:
select c1, c2 from tab1 where  ABS(c1) > ?;
The UDR from the other side of the expression can be a column expression or a built-in routine, but it cannot be a user-defined routine. In earlier releases, the SQLDescribeParam API returns SQL_UNKNOWN for expression values and parameters that are embedded in another procedure in the following cases:
  • The value on the other side of the expression is a user-defined routine.
  • Another operand of the same expression is a user-defined routine.
  • The data type of any operand of the expression is not a BOOLEAN, LVARCHAR, or a built-in non-opaque data type.