NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
C-101
Conversion of DDL Elementary Items
The following special DDL group is converted to the SQL VARCHAR data type:
02 A-VARCHAR.
03 LEN PIC S9(4) COMP.
03 VAL PIC N(len).
The field names in the special DDL group have the following meanings:
A-VARCHAR is the name of the special DDL VARCHAR group. Any valid DDL
group name can be used in place of A-VARCHAR.
LEN is a numeric field representing the actual length of the string. The string must
be defined as LEN PIC S9(4) COMP for the group to be recognized as this special
DDL group.
VAL is a fixed-length character field representing the maximum length of the string.
The data type of the character field can be PIC X(n), PIC A(n), TYPE
CHARACTER, or PIC N(n).
The following table shows how variable-length character strings are converted,
depending on the option you specify.
Conversion of Variable-Length Strings
With VARCHARS Option
CONVERT Option
SQL Data Type
PIC N Field
SQL Data Type
PIC X, PIC A or
CHARACTER Field
None VARCHAR(m) VARCHAR(j)
CHARACTER set VARCHAR(x)
CHARACER SET set
NATIONAL set VARCHAR(y)
CHARACTER SET set
NATIONAL DEFAULT NCHAR VARYING(k)
Without VARCHARS Option
None CHAR(m) CHAR(j)
CHARACTER set CHAR(x)
CHARACTER SET set
set An SQL-supported character set
j The number of single-byte characters
k The number of double-byte characters
m The number of characters; m is twice the corresponding
k
x The number of characters; x equals j for single-byte character sets and equals j/2 for double-
byte character sets
y The number of characters; y equals k for double-byte character sets and equals twice k for
single-byte character sets