Previous Topic Next topic Print topic


Fixed-length Character Strings

Fixed-length character strings (CHAR) are SQL data types with a driver-defined maximum length. They are declared in COBOL as:
PIC X(n)
where n is an integer between 1 and the maximum length.

Host Variable Formats

OpenESQL and DB2 ECM
01 char-field1      PIC X(5).
01 char-field2      PIC X(254).

The largest supported fixed length character string is 254 bytes for the DB2 ECM. If you need a character string greater than 254 bytes in length, use a VARCHAR field.

OpenESQL
01 char-field3      SQL TYPE IS CHAR(200).

The char-field3 format uses the CHAR SQL TYPE.

OpenESQL .NET Managed Runtime
In addition to the definitions valid for OpenESQL, the following definition is also valid for the OpenESQL .NET Managed Runtime:
01 char-net         string(200).
Previous Topic Next topic Print topic