ALLBASE/SQL Reference Manual (36216-90216)

208 Chapter7
Data Types
Type Specifications
Type Specifications
All the data in a column must be of the same type. Specify the data type for each column
when you create a table or when you add a column to an existing table. The
ALLBASE/SQL data types and the values you can specify for data of each type are shown
in Table 7-1.
Table 7-1. ALLBASE/SQL Data Types
Group Data Type Description
Alpha-
numeric
CHAR[ACTER][(
n
)] String of fixed length
n
, where
n
is an integer from 1 to
3996 bytes. The default size is CHAR (1). The keyword
CHARACTER is a synonym for CHAR.
VARCHAR(
n
) String of variable length no greater than
n
, where
n
must
be an integer from 1 to 3996 bytes.
Numeric DEC[IMAL][(
p
[,
s
])]
NUMERIC[(
p
[,
s
])]
Fixed-point packed decimal number with a precision
(maximum number of digits excluding sign and decimal
point) no greater than
p
, where
p
is 1 through 27, and a
scale (number of digits to the right of the decimal) of
s
,
where
s
is from 0 through
p
. E (exponential) and L (Pascal
longreal) notation are not allowed in the specification of a
decimal value. Operations on data of type DECIMAL are
often much more precise than operations on data of type
FLOAT.
The default for NUMERIC and DECIMAL types is
DECIMAL (27,0). DEC and NUMERIC are synonyms for
DECIMAL.
FLOAT[(
p
)] or
DOUBLE
PRECISION
Long (64-bit) floating pointnumber. This is an approximate
numeric value consisting of an exponent and a mantissa.
The precision,
p
, is a positive integer that specifies the
number of significant binary digits in the mantissa. The
value of
p
can be from 25 to 53. The default is 53.
The range of negative numbers that can be represented is
1.79769313486230E+308 to 2.22507385850721E308.
The range of positive numbers that can be represented is
2.22507385850721E308 to 1.79769313486230E+308. E
(exponential) or L (Pascal longreal) notation can be used to
specify FLOAT values.
DOUBLE PRECISION is a synonym for FLOAT(53).