C to SQL conversion for double-byte character data

You can convert the double-byte C data type, SQL_C_DBCHAR, to an SQL data type.

The following table shows information about converting double-byte character C data to SQL data.

Table 1. Conversion of double-byte character C data to SQL data
fSqlType Test SQLSTATE
SQL_CHAR SQL_VARCHAR SQL_LONGVARCHAR SQL_CLOB Data length <= Column length x 2 N/A
Data length > Column length x 2 01004
SQL_BINARY SQL_VARBINARY SQL_LONGVARBINARY SQL_BLOB Data length <= Column length x 2 N/A
Data length > Column length x 2 01004
SQL_XML None 000001
Note:
  1. SQLSTATE 00000 is not returned by SQLGetDiagRec(), rather it is indicated when the function returns SQL_SUCCESS.