Variable-length Character Strings

Variable-length character strings (VARCHAR) are SQL data types that can be declared in COBOL in a number of ways:

In your SQL statements you must reference the group name.

If the data being copied to a SQL CHAR, VARCHAR or LONG VARCHAR data type is longer than the defined length, then the data is truncated and the SQLWARN1 flag in the SQLCA data structure is set. If the data is smaller than the defined length, a receiving CHAR data type may be padded with blanks.

OpenESQL

OpenESQL accepts all formats as host variables. The maximum number of bytes you can use with OpenESQL host variables is 65000. For more information, see the OpenESQL SQL TYPEs in this chapter.