Open Client has four character types, CS_CHAR, CS_LONGCHAR, CS_VARCHAR, and CS_XML:
CS_CHAR corresponds to the Adaptive Server Enterprise types char and varchar. In other words, Client-Library interprets both the server char and varchar types as CS_CHAR. For example, ct_describe returns CS_CHAR_TYPE when describing a result column that has the server datatype varchar.
CS_LONGCHAR does not correspond to any Adaptive Server Enterprise datatype, but some Open Server applications may support CS_LONGCHAR. An application can call ct_capability and check the CS_DATA_LCHAR capability to determine whether an Open Server connection supports CS_LONGCHAR. If it does, then ct_describe can return CS_LONGCHAR when describing a result data item. A CS_LONGCHAR value has a maximum length of 2,147,483,647 bytes.
CS_VARCHAR does not correspond to any Adaptive Server Enterprise type. For this reason, Open Client routines do not return CS_VARCHAR_TYPE. CS_VARCHAR is a structure provided to enable non-C programming language veneers to be written for Open Client. It holds a string and its length:
typedef struct_cs_varchar
{
CS_SMALLINT len;
CS_CHAR str[CS_MAX_CHAR];
} CS_VARCHAR;
Typical client applications do not use CS_VARCHAR.
Corresponding directly to the xml datatype, CS_XML is an addition to CS_TEXT and CS_IMAGE datatypes for representing XML data. CS_XML represents XML data in an unparsed format and can be used anywhere CS_TEXT and CS_IMAGE is used, for example, in cs_convert, ct_bind, or ct_param.
CS_XML only fetches data if the server supports XML datatypes. CS_DATA_XML (request) and CS_DATA_NOXML (response), are added to ct_capability to determine the server’s capability to support XML datatypes.CS_XML is always activated, and its datatype constant is CS_XML_TYPE. The xml datatype is mapped to TDS_XML.