Determining compatibility of SQL and PL/I data types
PL/I host variables in SQL statements must be type compatible with the
columns which use them:
- Numeric data types are compatible with each other. A SMALLINT, INTEGER,
DECIMAL, or FLOAT column is compatible with a PL/I host variable of BIN FIXED(15),
BIN FIXED(31), DECIMAL(p,s), BIN FLOAT(n) where n is from 22 to 53, or DEC FLOAT(m) where m is from
7 to 16.
- Character data types are compatible with each other. A CHAR or VARCHAR
column is compatible with a fixed-length or varying-length PL/I character
host variable.
Graphic data types are compatible with each other. A GRAPHIC
or VARGRAPHIC column is compatible with a fixed-length or varying-length PL/I
graphic character host variable.
- Datetime data types are compatible with character host variables. A DATE,
TIME, or TIMESTAMP column is compatible with a fixed-length or varying-length
PL/I character host variable.
When necessary, the Database Manager automatically
converts a fixed-length character string to a varying-length string or a varying-length
string to a fixed-length character string.