Specifying the Data Type
Go Up to Defining Columns
When creating a table, you must specify the data type for each column. The data type defines the set of valid data that the column can contain. The data type also determines the set of allowable operations that can be performed on the data, and defines the disk space requirements for each data item.
Syntax
<data type> =
{SMALLINT|INTEGER|FLOAT|DOUBLE PRECISION} [<array_dim>]
| {DATE|TIME|TIMESTAMP} [<array_dim>]
| {DECIMAL | NUMERIC} [(precision [, scale])] [<array_dim>]
| {CHAR | CHARACTER | CHARACTER VARYING | VARCHAR} [(int)][<array_dim>] [CHARACTER SET charname]
| {NCHAR | NATIONAL CHARACTER | NATIONAL CHAR}[VARYING] [(int)] [<array_dim>]
| BLOB [SUB_TYPE {int | subtype_name}] [SEGMENT SIZE int][CHARACTER SET charname]
| BLOB [(seglen [, subtype])]
| BOOLEAN
<array_dim> = [x:y [, x1:y1 ...]]
- Note: <subtype_name> can be a
TEXTvalue.
- Note: The outermost brackets must be included when declaring arrays.
Supported data types
The general categories of data types that are supported include:
- Character data types.
- Integer data types.
- Decimal data types, both fixed and floating.
- A
DATEdata type to represent the date, aTIMEdata type to represent the time, and aTIMESTAMPdata type to represent both the date and time. - A
BOOLEANdata type. - A
BLOBdata type to represent unstructured binary data, such as graphics and digitized voice. - Arrays of data types (except for
BLOBdata).
See About InterBase Data Types for a complete list and description of data types that InterBase supports.