Use character data types for storing strings of letters, numbers and symbols.
Use this syntax for character data types.
CHAR [ ( max-length ) ]
CHARACTER [ ( max-length ) ]
CHARACTER VARYING [ ( max-length ) ]
VARCHAR [ ( max-length ) ]
UNIQUEIDENTIFIERSTR
This table describes the character data types.
Character Data Type |
Description |
---|---|
CHAR |
Character data of maximum length max-length bytes. If max-length is omitted, the default is 1. The maximum size allowed is 32KB – 1. See Notes for restrictions on CHAR data greater than 255 bytes. See the notes below on character data representation in the database, and on storage of long strings. All CHAR values are blank padded up to max-length, regardless of whether the BLANK PADDING option is specified. When multibyte character strings are held as a CHAR type, the maximum length is still in bytes, not characters. |
CHARACTER |
Same as CHAR. |
CHARACTER VARYING |
Same as VARCHAR. |
LONG VARCHAR |
Arbitrary length character data. The maximum size is limited by the maximum size of the database file (currently 2 gigabytes). |
TEXT |
This is a user-defined data type. It is implemented as a LONG VARCHAR allowing NULL. |
VARCHAR |
Same as CHAR, except that no blank padding is added to the storage of these strings, and VARCHAR strings can have a maximum length of (32KB – 1). See Notes for restrictions on VARCHAR data greater than 255 bytes. |
UNIQUEIDENTIFIERSTR |
Domain implemented as CHAR( 36 ). This data type is used for remote data access, when mapping Microsoft SQL Server uniqueidentifier columns. |