Built-in data types
A built-in data type is a fundamental data type that the database server defines. A fundamental data type is atomic; that is, it cannot be broken into smaller pieces. Built-in data types serve as building blocks for other data types. The following table summarizes the built-in data types that the database server provides.
| Data type | Category | Explanation |
|---|---|---|
| BIGINT | Numeric | Stores integers from -(263 -1) to 263 -1, which is -9,223,372,036,854,775,807 to 9,223,372,036,854,775,807, in eight bytes. |
| BIGSERIAL | Numeric | Stores a sequential integer, of the BIGINT data type, that is assigned automatically by the database server when a new row is inserted. The behavior of the BIGSERIAL data type is similar to the SERIAL data type, but with a larger range. |
| BLOB | Large object | Stores binary data in smart large objects in a format that supports random access |
| BOOLEAN | Miscellaneous | Stores the Boolean values for true and false |
| BYTE | Large object | Stores binary data in chunks that are not random access |
| CHAR(n) | Character | Stores single-byte or multibyte sequences of characters, including letters, numbers, and symbols of fixed length Collation is code-set dependent. |
| CHARACTER(n) | Character | Is a synonym for CHAR |
| CHARACTER VARYING(m,r) | Character | Is an ANSI-compliant version of the VARCHAR data type |
| CLOB | Large object | Stores text in smart large objects in a format that supports random access |
| DATE | Time | Stores a calendar date |
| DATETIME | Time | Stores a calendar date combined with the time of day |
| DEC | Numeric | Is a synonym for DECIMAL |
| DECIMAL(p) | Numeric | Stores numbers with definable scale and precision; is a floating-point data type |
| DECIMAL(p,s) | Numeric | Stores numbers with definable scale and precision; is a fixed-point data type |
| DOUBLE PRECISION | Numeric | Behaves the same way as FLOAT |
| FLOAT(n) | Numeric | Stores double-precision floating-point numbers that correspond to the double data type in C (on most platforms) |
| IDSSECURITYLABEL | Security | IsDISTINCT OF LVARCHAR, but see
note below |
| INT | Numeric | Is a synonym for INTEGER |
| INT8 | Numeric | Stores an 8-byte integer value These whole numbers can be in the range -(263-1) to 263-1. |
| INTEGER | Numeric | Stores whole numbers from -(231-1) to 231-1 |
| INTERVAL | Time | Stores a span of time |
| LVARCHAR(m) | Character | Stores single-byte or multibyte strings of letters,
numbers, and symbols of varying length to a maximum of 32,739 bytes
If you do not specify a maximum size, the default is 2048 bytes. LVARCHAR is also the external storage format for opaque data types. Collation is code-set dependent. |
| MONEY(p,s) | Numeric | Stores a currency amount |
| NCHAR(n) | Character | Stores single-byte and multibyte sequences of characters,
including letters, numbers, and symbols Collation is locale dependent. For more information, see the HCL® Informix® GLS User's Guide. |
| NUMERIC(p,s) | Numeric | Is a synonym for DECIMAL |
| NVARCHAR(m,r) | Character | Stores single-byte and multibyte sequences of characters,
including letters, numbers, and symbols of varying length to a maximum
of 255 bytes Collation is locale dependent. For more information, see the HCL® Informix® GLS User's Guide. |
| REAL | Numeric | Is a synonym for SMALLFLOAT |
| SERIAL | Numeric | Stores sequential integers; has the same range of positive values as INTEGER |
| SERIAL8 | Numeric | Stores large sequential integers; has the same range of positive values as INT8 |
| SMALLFLOAT | Numeric | Stores single-precision floating-point numbers that correspond to the float data type in C (on most platforms) |
| SMALLINT | Numeric | Stores whole numbers from -(215-1) to 215-1 |
| TEXT | Large object | Stores text data in chunks that are not random access |
| VARCHAR(m,r) | Character | Stores single-byte or multibyte strings of letters,
numbers, and symbols of varying length to a maximum of 255 bytes Collation is code-set dependent. |
DISTINCT OF LVARCHAR definition,
type IDSSECURITYLABEL is not classified here in the Character category,
because rather than storing text data, a column of this type stores
a label that associates its table with a label-based access control
(LBAC) security policy. In databases that support LBAC, this can apply
row-level protection or column-level protection (or both) to all the
data types in the table.