Home | Previous Page | Next Page   Extending Data Types > Understanding Data Types >

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. Table 5 summarizes the built-in data types that the database server provides.

Table 5. Built-In Data Types
Data Type Explanation
BLOB Stores binary data in smart large objects in a format that supports random access
BOOLEAN Stores the Boolean values for true and false
BYTE Stores binary data in chunks that are not random access
CHAR(n) Stores single-byte or multibyte sequences of characters, including letters, numbers, and symbols of fixed length Collation is code-set dependent.
CHARACTER(n) Is a synonym for CHAR
CHARACTER VARYING(m,r) Is an ANSI-compliant version of the VARCHAR data type
CLOB Stores text in smart large objects in a format that supports random access
DATE Stores a calendar date
DATETIME Stores a calendar date combined with the time of day
DEC Is a synonym for DECIMAL
DECIMAL Stores numbers with definable scale and precision
DOUBLE PRECISION Behaves the same way as FLOAT
FLOAT(n) Stores double-precision floating-point numbers that correspond to the double data type in C (on most platforms)
INT Is a synonym for INTEGER
INT8 Stores an 8-byte integer value These whole numbers can be in the range -(263-1) to 263-1.
INTEGER Stores whole numbers from -(231-1) to 231-1
INTERVAL Stores a span of time
LVARCHAR Stores single-byte or multibyte strings of letters, numbers, and symbols of varying length to a maximum of 32 kilobytes It is also the external storage format for opaque data types. Collation is code-set dependent.
MONEY(p,s) Stores a currency amount
NCHAR(n) Stores single-byte and multibyte sequences of characters, including letters, numbers, and symbols Collation is locale dependent. For more information, see the IBM Informix: GLS User's Guide.
NUMERIC(p,s) Is a synonym for DECIMAL
NVARCHAR(m,r) 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 IBM Informix: GLS User's Guide.
REAL Is a synonym for SMALLFLOAT
SERIAL Stores sequential integers; has the same range of values as INTEGER
SERIAL8 Stores large sequential integers; has the same range of values as INT8
SMALLFLOAT Stores single-precision floating-point numbers that correspond to the float data type in C (on most platforms)
SMALLINT Stores whole numbers from -(215-1) to 215-1
TEXT Stores text data in chunks that are not random access
VARCHAR(m,r) 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.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]