VARCHAR2 and NVARCHAR2

The VARCHAR2 and NVARCHAR2 data types support applications that use the Oracle VARCHAR2 and NVARCHAR2 data types.

Important: Db2 Big SQL only tolerates the Oracle VARCHAR2 and NVARCHAR2 data types, which are mapped to data types that are supported in Db2 Big SQL.

Effects

When the VARCHAR2 data type is explicitly encountered in SQL statements, it is implicitly mapped to the VARCHAR data type. The maximum length for VARCHAR2 is 32672 bytes or 8168 characters, which is the same as the maximum length for VARCHAR of 32672 octets or 8168 CODEUNITS32. Similarly, when the NVARCHAR2 data type is explicitly encountered in SQL statements, it is implicitly mapped by following the same rules as those for the NVARCHAR data type.