Character strings

A character string is a sequence of bytes. The length of the string is the number of bytes in the sequence. If the length is zero, the value is called the empty string. The empty string should not be confused with the null value.

Fixed-length character strings

When fixed-length character string distinct types, columns, and variables are defined, the length attribute is specified and all values have the same length. For a fixed-length character string, the length attribute must be between 1 through 32766 inclusive. See SQL limits for more information.

Varying-length character strings

The types of varying-length character strings are:

A Character Large OBject (CLOB) column is useful for storing large amounts of character data, such as documents written using a single character set.

Distinct types, columns, and variables all have length attributes. When varying-length character-string distinct types, columns, and variables are defined, the maximum length is specified and this becomes the length attribute. Actual values may have a smaller length. For a varying-length character string, the length attribute must be between 1 through 32 740 inclusive. For a CLOB string, the length attribute must be between 1 through 2 147 483 647 inclusive. See SQL limits for more information.

For the restrictions that apply to the use of long varying-length strings, see Limitations on use of strings.

Character-string variables