C to SQL conversion for timestamp_ext_tz data

You can convert the timestamp C data type, SQL_C_TYPE_TIMESTAMP_EXT_TZ, to an SQL data type.

The following table shows information about converting timestamp_ext_tz C data to SQL data.

Table 1. Conversion of timestamp_ext_tz C data to SQL data
fSqlType Test SQLSTATE
SQL_CHAR
SQL_VARCHAR
Column length >= Display size 000001
19 <= Column length < Display size 01004
Column length < 19 22003
Fractional seconds field length > 18 (display size > 38) 22008
SQL_TYPE_DATE Data value is a valid date, and time fields are 0 000001
Data value is a valid date, and time fields are not 02 01004
Data value is not a valid date 22008
Data value is a valid date, and time zone fields are not 04 01004
SQL_TYPE_TIME Data value is a valid time. Fractional seconds fields are zero. 000001
Data value is a valid time. Fractional seconds fields are not zero. 01004
Data value is not a valid time. 22008
Data value is a valid time, and time zone fields are not 04. 01004
SQL_TYPE_TIMESTAMP Data value is a valid timestamp 000001
Data value is not a valid timestamp 22008
Precision specified by TIMESTAMP(p) <= fractional seconds field length <= 123 000001
Data value is a valid time, and time zone fields are not 04. 01004
SQL_TYPE_TIMESTAMP_WITH_TIMEZONE
SQL_TYPE_TIME-
STAMP_WITH_TIMEZONE
Data value is a valid timestamp with time zone 000001
Data value is not a valid timestamp with time zone 22008
Precision specified by TIMESTAMP(p) < fractional seconds field length <= 123 000001
Notes:
  1. SQLSTATE 00000 is not returned by SQLGetDiagRec(), rather it is indicated when the function returns SQL_SUCCESS.
  2. The time portion of the timestamp is deleted.
  3. Fractional seconds of the timestamp are truncated.
  4. The time zone portion of the timestamp is deleted.