Declaration of graphic host variables in C and C++ embedded SQL applications

To handle graphic data in C or C++ applications, you must use host variables based on either the wchar_t C or C++ data type or the sqldbchar data type.

You can assign graphic data host variables to columns of a table that are GRAPHIC, VARGRAPHIC, or DBCLOB. For example, you can update or select DBCS data from GRAPHIC or VARGRAPHIC columns of a table.

There are three valid forms for a graphic host variable:
  • Single-graphic form

    Single-graphic host variables have an SQLTYPE of 468/469 that is equivalent to the GRAPHIC(1) SQL data type.

  • Null-terminated graphic form

    Null-terminated refers to the situation where all the bytes of the last character of the graphic string contain binary zeros ('\0's). They have an SQLTYPE of 400/401.

  • VARGRAPHIC structured form

    VARGRAPHIC structured host variables have an SQLTYPE of 464/465 if their length is between 1 and 16 336 bytes. They have an SQLTYPE of 472/473 if their length is between 2 000 and 16 350 bytes.