Implicit casting for character and graphic constants

Implicit casting (or weak typing) is an alternative way to parse character or graphic constants for applications that expect these constants to be assigned the data types CHAR or GRAPHIC. This capability does not apply to the Entry plan of the Db2® Warehouse on Cloud managed service.

Effects

When operating in Oracle compatibility mode, the data type of a character or graphic constant depends on the setting of the environment string unit and on the length of the constant:
String Constant Type Environment String Unit Size Data Type
Character CODEUNITS16 or OCTETS ≤ 255 bytes CHAR
CODEUNITS32 ≤ 63 code units
CODEUNITS16 or OCTETS > 255 bytes VARCHAR
CODEUNITS32 > 63 code units
Graphic CODEUNITS16 or OCTETS ≤ 254 bytes GRAPHIC
CODEUNITS32 ≤ 63 code units
CODEUNITS16 or OCTETS > 254 bytes VARGRAPHIC
CODEUNITS32 > 63 code units