You use the data type CHARACTER or CHAR for columns that can store alphanumeric values of a fixed length (see section "Alphanumeric literals").
[{[
dimension ] | (
dimension )}] CHAR[ACTER][(
length )]
dimension
Unsigned integer between 1 and 255. The column is a multiple column; dimension indicates the number of column elements. dimension can be enclosed in square brackets or parentheses.
dimension omitted:
The column is an atomic column.
length
Unsigned integer between 1 and 256 that indicates the length of the CHAR column.
length omitted:
length=1.
Range of values for CHAR columns
A CHAR column can contain alpnanumeric values of the length specified for the column.
Example
The CUSTOMERS table contains 6 CHAR columns of varying lengths. company CHAR(40) NOT NULL street CHAR(40) city CHAR(40) country CHAR(3) cust_tel CHAR(25) cust_info CHAR(50) |