C to SQL: Date

The date IBM® Informix® ODBC Driver C data type is SQL_C_DATE.

The following table shows the IBM Informix ODBC Driver SQL data types to which date C data can be converted.
fSqlType Test SQLSTATE
SQL_CHAR

SQL_LONGVARCHAR

SQL_VARCHAR

Column length ≥ 10. N/A
Column length < 10. 22003
Data value is not a valid date. 22008
SQL_DATE Data value is a valid date. N/A
Data value is not a valid date. 22008
SQL_TIMESTAMP Data value is a valid date. Informix ODBC driver sets the time portion of the time stamp to zero. N/A
Data value is not a valid date. 22008

When IBM Informix ODBC Driver converts date C data to character SQL data, the resulting character data is in the yyyy-mm-dd format.

IBM Informix ODBC Driver ignores the value that the pcbValue argument of SQLBindParameter points to and the value of the cbValue argument of SQLPutData when it converts data from the date C data type. IBM Informix ODBC Driver uses the size of rgbValue for the size of the date C data type.