Always use TDSVARYCHAR rather than TDSVARCHAR. DBVARCHAR and TDSVARYCHAR objects include a length specification that precedes the data, just like DB2 variable datatypes. The length specification occupies the initial two bytes of the field (in binary format) and is referred to in print as “LL”.
In Client-Library, the CS-VARCHAR datatype
includes the “LL” length specifications and can
be mapped to TDSVARYCHAR.