Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

NCHAR VARYING(n)

Description

Variable-length national character strings are represented as NCHAR VARYING(n), where n is the number of characters. As with NCHAR, n must not be considered as the byte size because one character is stored as more than one byte in some language character sets. If n is not specified, the maximum length is set to 536,870,911. When the length of a character string exceeds n, the exceeding characters are truncated if they are space characters, or processed as an error otherwise. When a character string shorter than n is stored, the trailing space is not filled with space characters. That is, only necessary parts are stored.

NCHAR VARYING(n), NATIONAL CHAR VARYING(n) and NATIONAL CHARACTER VARYING(n) can be used interchangeably.

Note
  • n must be a number greater than 0.
  • The number of national character sets that can be used in a single database is set to be one. For example 8-bit ISO 8889-1 (Latin-1) and JIS X 208: EUC code sets cannot be used simultaneously in the same database.
  • An error occurs if a non-national character string (whether it is fixed-length or variable-length) is specified for an attribute declared as a national character string.
  • Using two different character code sets at the same time also causes an error.
Example

If you specify N'Härder' as NCHAR VARYING(8), 'Härder' is stored (a 6-character string).
If you specify N'Härder' as NCHAR VARYING(6), 'Härder' is stored (a 6-character string).
If you specify 'pacesetter' as NCHAR(12), an error occurs (that is, if a non-national string is specified for an attribute declared as a national character string).