CHAR(n) data type

The CHAR data type stores any string of letters, numbers, and symbols. It can store single-byte and multibyte characters, based on the database locale.

A CHAR(n) column has a length of n bytes, where 1 < n < 32,767. If you do not specify n, CHAR(1) is the default length. Character columns typically store alphanumeric strings, such as names, addresses, phone numbers, and so on. When a value is retrieved or stored as CHAR(n), exactly n bytes of data are transferred. If the string is shorter than n bytes, the string is extended with blank spaces up to the declared length. If the data value is longer than n bytes, a data string of length n that has been truncated from the right is inserted or retrieved, without the database server raising an exception.

This does not create partial characters in multibyte locales. In right-to-left locales, such as Arabic, Hebrew, or Farsi, the truncation is from the left.

Size specifications in CHAR data type declarations can be affected by the SQL_LOGICAL_CHAR feature that is described in the section Logical Character Semantics in Character Type Declarations.

For more information about East Asian locales that support multibyte code sets, see Multibyte Characters with VARCHAR.