C to SQL: Time stamp

The time stamp IBM® Informix® ODBC Driver C data type is SQL_C_TIMESTAMP.

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

SQL_LONGVARCHAR

SQL_VARCHAR

Column length ≥ Display size. N/A
19 ≤ Column length < Display size.

IBM Informix ODBC Driver truncates the fractional seconds of the time stamp.

01004
Column length < 19. 22003
Data value is not a valid date. 22008
SQL_DATE Time fields are zero. N/A
Time fields are non-zero.

IBM Informix ODBC Driver truncates the time fields of the time stamp structure.

01004
Data value does not contain a valid date. 22008
SQL_TIMESTAMP Fractional seconds fields are not truncated. N/A
Fractional seconds fields are truncated.

IBM Informix ODBC Driver truncates the fractional seconds fields of the time stamp structure.

01004
Data value is not a valid time stamp. 22008

When IBM Informix ODBC Driver converts time stamp C data to character SQL data, the resulting character data is in the yyyy-mm-dd hh:mm:ss[.f...] 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 time stamp C data type. IBM Informix ODBC Driver uses the size of rgbValue for the size of the time stamp C data type.