This structure is used to pass variable length data to
the database manager.
Table 1. Fields in the SQLCHAR Structure Field Name |
Data Type |
Description |
LENGTH |
SMALLINT |
Length of the character string pointed to by
DATA. |
DATA |
CHAR(n) |
An array of characters of length LENGTH. |
API and data structure syntax
SQL_STRUCTURE sqlchar
{
short length;
_SQLOLDCHAR data[1];
};
COBOL Structure
This is not defined in
any header file. The following is an example that shows how to define
the structure in COBOL:
* Replace maxlen with the appropriate value:
01 SQLCHAR.
49 SQLCHAR-LEN PIC S9(4) COMP-5.
49 SQLCHAR-DATA PIC X(maxlen).