Variable-length character strings (VARCHAR) are SQL data types that can be declared in COBOL in a number of ways:
For example:
03 varchar1. 49 varchar1-len pic 9(4) comp. 49 varchar1-data pic x(200). 03 Longvarchar1. 49 Longvarchar1-len pic 9(4) comp-5. 49 Longvarchar1-data pic x(30000).
In your SQL statements you must reference the group name.
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.