DB2 10.5 for Linux, UNIX, and Windows

National character strings

A national character string is a sequence of bytes that represents character data in UTF-8 or UTF16BE encoding in a Unicode database.

The length of the string is the number of code units in the sequence. If the length is zero, the value is called the empty string. This value should not be confused with the null value.

National character strings are synonyms for character strings or graphic strings. Based on the value that is set for nchar_mapping database configuration parameter, national character strings are mapped as follows:
nchar_mapping is CHAR_CU32 in a Unicode database:
  • NCHAR is a synonym for CHARACTER with string units CODEUNITS32
  • NVARCHAR is a synonym for VARCHAR with string units CODEUNITS32
  • NCLOB is a synonym for CLOB with string units CODEUNITS32
nchar_mapping is GRAPHIC_CU32 in a Unicode database:
  • NCHAR is a synonym for GRAPHIC with string units CODEUNITS32
  • NVARCHAR is a synonym for VARGRAPHIC with string units CODEUNITS32
  • NCLOB is a synonym for DBCLOB with string units CODEUNITS32
nchar_mapping is GRAPHIC_CU16 in a Unicode database:
  • NCHAR is a synonym for GRAPHIC with string units CODEUNITS16
  • NVARCHAR is a synonym for VARGRAPHIC with string units CODEUNITS16
  • NCLOB is a synonym for DBCLOB with string units CODEUNITS16

For details, refer to the topics "Character strings" and "Graphic strings".