Data types can be classified into groups of related data types. Within such groups, an order of precedence exists in which one data type is considered to precede another data type. This precedence enables the database manager to support the promotion of one data type to another data type that appears later in the precedence order. For example, the database manager can promote the data type CHAR to VARCHAR and the data type INTEGER to DOUBLE PRECISION; however, the database manager cannot promote a CLOB to a VARCHAR.
The database manager considers the promotion of data types when:
For each data type, Table 7 shows the precedence list (in order) that the database
manager uses to determine the data types to which each data type can be
promoted. The table indicates that the best choice is the same data
type and not promotion to another data type. Note that the table also
shows data types that are considered equivalent during the promotion
process. For example, CHARACTER and GRAPHIC are considered to be
equivalent data types.
Table 7. Precedence of Data Types
| Data Type * | Data Type Precedence List (in best-to-worst order) | ||
|---|---|---|---|
| CHAR or GRAPHIC | CHAR or GRAPHIC, VARCHAR or VARGRAPHIC, CLOB or DBCLOB | ||
| VARCHAR or VARGRAPHIC | VARCHAR or VARGRAPHIC, CLOB or DBCLOB | ||
| CLOB or DBCLOB | CLOB or DBCLOB | ||
| BLOB | BLOB | ||
| SMALLINT | SMALLINT, INTEGER, BIGINT, DECIMAL or NUMERIC, REAL, DOUBLE | ||
| INTEGER | INTEGER, BIGINT, DECIMAL or NUMERIC, REAL, DOUBLE | ||
| BIGINT | BIGINT, DECIMAL or NUMERIC, REAL, DOUBLE | ||
| DECIMAL or NUMERIC | DECIMAL or NUMERIC, REAL, DOUBLE | ||
| REAL | REAL, DOUBLE | ||
| DOUBLE | DOUBLE | ||
| DATE | DATE | ||
| TIME | TIME | ||
| TIMESTAMP | TIMESTAMP | ||
| DATALINK | DATALINK | ||
| A distinct type | The same distinct type | ||
| |||