Character Set Storage Requirements

From InterBase
Jump to: navigation, search

Go Up to Character Sets and Collation Orders


It is important to know the storage requirements of a particular character set because InterBase restricts the maximum amount of storage in each field of a CHAR column to 32,767 bytes. VARCHAR columns are restricted to 32,765 bytes.

For character sets that require only a single byte of storage per character, the maximum number of characters that can be stored in a single field corresponds to the number of bytes. For character sets that require multiple bytes per character, determine the maximum number of symbols that can be safely stored in a field by dividing 32,767 or 32,765 by the number of bytes required for each character.

For example, for a CHAR column defined to use the UNICODE_FSS character set, the maximum number of characters that can be specified is 10,922 (32,767/3).

CHAR (10922) CHARACTER SET UNICODE_FSS;