Data type conversion table: Informix to DB2
Informix® data types | DB2® data types |
---|---|
CHAR(n) |
CHAR(n) (max is 255 bytes, see note 1) |
VARCHAR(n[,m]) |
VARCHAR(n) (max is 32672 bytes, see note 1) |
LVARCHAR(n) |
VARCHAR(n) (max is 32672 bytes, see note 1) |
NCHAR(n) |
NCHAR(n) (synonym! see note 1) |
NVARCHAR(n[,m]) |
NVARCHAR(n[,m]) (synonym! see note 1) |
BOOLEAN |
BOOLEAN (CHAR(1) with DB2 <
11.1) |
SMALLINT |
SMALLINT |
INTEGER |
INTEGER |
BIGINT |
BIGINT |
INT8 |
BIGINT |
SERIAL[(start)] |
INTEGER (see note 2) |
BIGSERIAL[(start)] |
BIGINT (see note 2) |
SERIAL8[(start)] |
BIGINT (see note 2) |
DOUBLE PRECISION / FLOAT[(n)] |
FLOAT[(n)] / DOUBLE |
REAL / SMALLFLOAT |
REAL |
DECIMAL(p,s) |
DECIMAL(p,s) (max is 31 digits) |
DECIMAL(p) with p<=15 |
DECFLOAT(16) |
DECIMAL(p) with p>15 |
DECFLOAT(16) if p=16,
DECFLOAT(34) if p>16 |
DECIMAL |
DECFLOAT(34) |
MONEY(p,s) |
DECIMAL(p,s) (max is 31 digits) |
MONEY(p) |
DECIMAL(p,2) (max is 31 digits) |
MONEY |
DECIMAL(16,2) |
DATE |
DATE |
DATETIME HOUR TO MINUTE |
TIME |
DATETIME HOUR TO SECOND |
TIME |
DATETIME HOUR TO FRACTION(n) |
TIMESTAMP (for fraction storage) |
DATETIME YEAR TO MONTH |
TIMESTAMP |
DATETIME YEAR TO DAY |
TIMESTAMP |
DATETIME YEAR TO HOUR |
TIMESTAMP |
DATETIME YEAR TO MINUTE |
TIMESTAMP |
DATETIME YEAR TO SECOND |
TIMESTAMP |
DATETIME YEAR TO FRACTION(n) |
TIMESTAMP |
INTERVAL q1 TO q2 |
CHAR(50) |
TEXT |
CLOB (of 500K) |
BYTE |
BLOB (of 500K) |
Notes:
- For more information about character data types, see CHAR and VARCHAR data types
- For more details about serial emulation, see SERIAL and BIGSERIAL data types.