About InterBase Data Types
Go Up to Specifying Data Types
When creating a new column in an InterBase table, the primary attribute that you must define is the data type, which establishes the set of valid data that the column can contain. Only values that can be represented by that data type are allowed. Besides establishing the set of valid data that a column can contain, the data type defines the kinds of operations that you can perform on the data. For example, numbers in INTEGER
columns can be manipulated with arithmetic operations, while CHARACTER
columns cannot.
The data type also defines how much space each data item occupies on the disk. Choosing an optimum size for the data value is an important consideration when disk space is limited, especially if a table is very large. InterBase supports the following data types:
INTEGER
andSMALLINT
FLOAT
andDOUBLE PRECISION
NUMERIC
andDECIMAL
DATE, TIME,
andTIMESTAMP
CHARACTER
andVARYING CHARACTER
BOOLEAN
BLOB
InterBase provides the Blob data type to store data that cannot easily be stored in one of the standard SQL data types. A BLOB
is used to store data objects of indeterminate and variable size, such as bit-mapped graphics images, vector drawings, sound files, video segments, chapter or book-length documents, or any other kind of multimedia information.
InterBase also supports arrays of most data types. An array is a matrix of individual items composed of any single InterBase data type (except BLOB
). An array can have from 1 to 16 dimensions. An array can be handled as a single entity, or manipulated item-by-item.
A TIMESTAMP
data type is supported that includes information about year, month, day of the month, and time. The TIMESTAMP
data type is stored as two long integers, and requires conversion to and from InterBase when entered or manipulated in a host-language program. The DATE
data type includes information on the year, month, and day of the month. The TIME
data type includes information about time in hours, minutes, seconds, and tenths, hundredths, and thousandths of seconds.
The following table describes the data types supported by InterBase:
Name | Size | Range/Precision | Description |
---|---|---|---|
|
Variable |
|
|
BOOLEAN |
16 bits |
|
|
|
<n> characters |
|
|
|
32 bits |
1 Jan 100 a.d. |
|
|
Variable |
|
|
|
64 bits1 |
2.225 x 10–308 to 1.797 x 10308 |
IEEE double precision: 15 digits |
|
32 bits |
1.175 x 10–38 to 3.402 x 1038 |
IEEE single precision: 7 digits |
|
32 bits |
–2,147,483,648 to 2,147,483,647 |
Signed long (longword) |
|
Variable (16, 32, or |
|
|
|
16 bits |
–32,768 to 32,767 |
Signed short (word) |
TIME |
32 bits |
0:00 AM-23:59:59.9999 PM |
Unsigned integer of InterBase type |
TIMESTAMP |
64 bits |
1 Jan 100 a.d. |
InterBase type ISC_TIMESTAMP ; combines DATE and TIME information
|
|
<n> characters |
|
|
- Actual size of DOUBLE is platform-dependent. Most platforms support the 64-bit size.