Data Type INTEGER in Logical Data Type Definition Class

About Data Type Integer in Logical Data Type Definition Class

In DB2 environment, the Dbms Data Type Length, and the Data Storage Precision Properties for Dbms Data Type as INTEGER are meaningless in the Logical Data Type class and can be ignored.

There is a difference in the way the data type NUMBER is represented in Oracle and DB2.

In Oracle, while defining a NUMBER column it accepts precision and scale as input. Oracle validates the precision and scale of the data when you try to insert or update a column having datatype NUMBER.

For example, if you define a NUMBER(2,1) column, the valid entries would be 1, 10, 10.1, 99.9 and so on, but not 100.1 because the column having data type of NUMBER(2,1) accept data upto 2.

In DB2, three data types are mapped to the Oracle NUMBER data type:

  •  SMALLINT - Two-byte binary integer with a precision of 5 bits. The range of this data type is -32, 768 to +32, 767 mapped to ORACLE NUMBER (6, 0) INTEGER - Four-byte binary integer. With a precision of 10 digits. The range of this data type is -2, 147, 483, 648 to +2, 147, 483, 647 mapped to ORACLE NUMBER (11, 0)

  •  BIGINT - An eight-byte large binary integer with a precision of 19 digits. The range of this data type is -9, 223, 372, 036, 854, 775, 808 to +9, 223, 372, 036, 854, 775, 807 mapped to ORACLE NUMBER (19, 0).

All the three DB2 data types have their own fixed range of valid digits and do not take precision or scale as input.