Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Data types

The data type specifies the range of permitted values for a column. In SQL, the data type for a column is defined with the column definition (see "Column") in the statements CREATE TABLE or ALTER TABLE.

BLOBs (Binary Large Objects) are based on existing data types in SESAM/SQL and are therefore not a new data type in themselves. The structure and method for processing such objects are described in section “BLOB constructs”.

Data type

SQL syntax

Range of values

Alphanumeric data
type:
fixed-length
alphanumeric string

CHAR[ACTER] [(length)]
length:
fixed column length in characters;
unsigned integer, 1 through 256

Alphanumeric string of length
length

The CHAR data type is stored with
its significant length only, without
trailing spaces.

Alphanumeric data
type:
alphanumeric string
of length 0 through
max

{ CHAR[ACTER] VARYING(max) |
VARCHAR (max) }
max:
maximum length of column in
characters; unsigned integer, 1 through
32000

Alphanumeric string shorter than
or equal to the length max

National data type:
fixed-length national
string

{ NATIONAL CHAR[ACTER] |
NCHAR }
[(cu_length [CODE_UNITS])]
cu_length:
fixed column length in code units
(1 code unit = 2 byte); unsigned integer,
1 through 128

National sring of length cu_length

The NCHAR data type is stored
with its significant length only,
without trailing spaces

National data type:
national string of
length 0 through
cu_max

{ NATIONAL CHAR[ACTER] VARYING |
NCHAR VARYING |
NVARCHAR }
(cu_max [CODE_UNITS])
cu_max:
maximum length of column in code units
(1 code unit = 2 byte); unsigned integer,
1 through 16000

National stringshorter than or
equal to the length cu_max

Numeric:
small integer

SMALLINT

-215 through 2<sup>15 </sup>through 215-1

Numeric:
large integer

INT[EGER]

-231 through 231-1

Numeric:
fixed-point number

NUMERIC [(precision[,scale])]
precision:
number of decimal digits; unsigned
integer, 1 through 31
scale:
number of digits after the decimal point;
unsigned integer, 0 through precision

Fixed-point numbers with a value
of 0 or in the range


10-scale through

10precision-scale-10-scale

The NUMERIC and DECIMAL
data types are stored with their
significant length only, without
leading zeros.

Numeric:
fixed-point number

DEC[IMAL] [(precision[,scale])]
precision:
number of decimal digits; unsigned
integer, 1 through 31
scale:
number of digits after the decimal point;
unsigned integer, 0 through precision

Numeric:
single-precision
floating-point number

REAL

Floating-point numbers with a
value of 0 or in the range

5.4E-79 through 7.2E+75

Numeric:
double-precision
floating-point number

DOUBLE PRECISION

Numeric:
floating- point
number

FLOAT[(precision)]
precision:
minimum number of binary digits for the
mantissa; unsigned integer, 1 through
53

Time data type:
date

DATE

Date specification from the range
0001-01-01 through 9999-12-31

Time data type:
time

TIME(3)

Time specification from the range
00:00:00.000 through
23:59:61.999

Time data type:
time stamp with date
and time

TIMESTAMP(3)

Date specification as for DATE,
time as for TIME(3)

Tabelle 30: Data types in SESAM/SQL