C to SQL conversion for binary data

You can convert the binary C data types, SQL_C_BINARY and SQL_C_BINARYXML, to SQL data types.

The following table shows information about converting C data of type SQL_C_BINARY to SQL data.

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

The following table shows information about converting C data of type SQL_C_BINARYXML to SQL data.

Table 2. Conversion of SQL_C_BINARYXML data to SQL data
fSqlType Test SQLSTATE
SQL_XML None 000001
Note:
  1. SQLSTATE 00000 is not returned by SQLGetDiagRec(), rather it is indicated when the function returns SQL_SUCCESS.