SQL to C conversion for graphic data

The graphic SQL data types that you can convert to C data types are SQL_GRAPHIC, SQL_VARGRAPHIC, SQL_LONGVARGRAPHIC, and SQL_DBCLOB.

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

Table 1. Conversion of graphic SQL data to C data
fCType Test rgbValue pcbValue SQLSTATE
SQL_C_CHAR Number of double-byte characters * 2 <= cbValueMax Data Length of data (in bytes) 000001
Number of double-byte characters * 2 <= cbValueMax Truncated data, to the nearest even byte that is less than cbValueMax. Length of data (in bytes) 01004
  • SQL_C_DBCHAR
  • SQL_C_WCHAR
Number of double-byte characters * 2 < cbValueMax Data Length of data (in bytes) 000001
Number of double-byte characters * 2 >= cbValueMax Truncated cbValueMax. data, to the nearest even byte that is less than cbValueMax. Length of data (in bytes) 01004
Note:
  1. SQLSTATE 00000 is not returned by SQLGetDiagRec(), rather it is indicated when the function returns SQL_SUCCESS.