Open Server has three binary types, CS_BINARY, CS_LONGBINARY, and CS_VARBINARY.
CS_BINARY corresponds to the Adaptive Server Enterprise datatypes binary and varbinary. That is, Server-Library interprets both the server binary and varbinary types as CS_BINARY. For example, srv_descfmt returns CS_BINARY_TYPE when retrieving a description of a binary parameter from a client.
CS_BINARY is defined as:
typedef unsigned char CS_BINARY;
CS_LONGBINARY does not correspond to any Adaptive Server Enterprise datatype, but some Open Server applications may support CS_LONGBINARY. An application can use the CS_DATA_LBIN capability to determine whether a Client-Library connection supports CS_LONGBINARY.
A CS_LONGBINARY value has a maximum length of 2,147,483,647 bytes. CS_LONGBINARY is defined as:
typedef unsigned char CS_LONGBINARY;
CS_VARBINARY does not correspond to any Adaptive Server Enterprise datatype. For this reason, Open Server routines do not return CS_VARBINARY_TYPE. If a datatype is described as CS_VARBINARY_TYPE, Open Server automatically converts it to a nullable CS_BINARY_TYPE before sending it to a client. CS_VARBINARY_TYPE can only be used when binding program variables. CS_VARBINARY enables programmers to write non-C programming language veneers for Open Server. Typical server applications will not use CS_VARBINARY.
CS_VARBINARY is defined as follows:
typedef struct _cs_varybin
{
CS_SMALLINT len;
CS_BYTE array[CS_MAX_CHAR];
} CS_VARBINARY;
where:
len is the length of the binary array.
array is the array itself.