Character and graphic strings are compatible with other character
and graphic strings as long as there is a conversion between their corresponding
CCSIDs.
Table 1. Result data types with string
operandsOne operand |
Other operand |
Data type of the result |
CHAR(x) |
CHAR(y) |
CHAR(z) where z = max(x,y) |
GRAPHIC(x) |
CHAR(y) |
VARGRAPHIC(y) where y >
maximum length of a graphic |
GRAPHIC(x) |
CHAR(y) |
GRAPHIC(z) where z = max(x,y) |
VARCHAR(x) |
VARCHAR(y) or CHAR(y) |
VARCHAR(z) where z = max(x,y) |
VARCHAR(x) |
GRAPHIC(y) |
VARGRAPHIC(z)
where z = max(x,y) |
VARGRAPHIC(x) |
VARGRAPHIC(y), GRAPHIC(y),
VARCHAR(y), or CHAR(y) |
VARGRAPHIC(z) where z = max(x,y) |
CLOB(x) |
CLOB(y), VARCHAR(y),
or CHAR(y) |
CLOB(z) where z = max(x,y) |
CLOB(x) |
GRAPHIC(y)
or VARGRAPHIC(y) |
DBCLOB(z)
where z = max(x,y) |
DBCLOB(x) |
CHAR(y), VARCHAR(y),
CLOB(y), GRAPHIC(y), VARGRAPHIC(y),
or DBCLOB(y) |
DBCLOB(z) where z = max(x,y) |
Character string subtypes are determined as indicated in the following
table:
Table 2. Result data types with character
string operandsOne operand |
Other operand |
Data type of the result |
Bit data |
Mixed, SBCS, or bit data |
Bit data |
Mixed data |
Mixed or SBCS data |
Mixed data |
SBCS data |
SBCS data |
SBCS data |