String data types

Exasol supports two SQL standard types for characters: CHAR and VARCHAR.

CHAR(n) has a fixed and pre-defined length n. If you insert a value that is shorter than n, space characters are automatically added to fill the remaining space (padding). The maximum allowed length is 2,000 characters.

VARCHAR(n) can contain a string of the length n or smaller. The string is stored in its actual length without padding. The maximum allowed length is 2,000,000 characters.

You can use ASCII or UTF-8 (Unicode) to define the character set in CHAR and VARCHAR. If no character set is defined, UTF-8 is used by default.

Data type Character set Note

CHAR(n)

ASCII, UTF-8

n = number of characters (optional)

1 ≤ n ≤ 2000, default = 1

VARCHAR(n)

ASCII, UTF-8

n = number of characters

1 ≤ n ≤ 2,000,000