Available numeric conversions depend on the datatype characteristics.
Datatype |
Converts to |
Comments |
---|---|---|
NUMERIC or DECIMAL |
SIGNED INTEGER |
A NUMERIC or DECIMAL datatype with scale 0 can be converted into a SIGNED INTEGER, provided the precision required to represent the maximum value of the integer is greater than or equal to the precision of the NUMERIC or DECIMAL datatype. |
NUMERIC or DECIMAL |
INTEGER |
NUMERIC or DECIMAL datatypes with a scale other than zero cannot be converted into INTEGERS, and numerics cannot be converted into UNSIGNED INTEGERS. |
NUMERIC or DECIMAL |
Other NUMERIC or DECIMAL datatypes |
A NUMERIC or DECIMAL datatype can be converted into other NUMERIC or DECIMAL datatypes, provided that the scale of the target type is greater than or equal to the scale of the source NUMERIC, and the precision of the target NUMERIC is greater than or equal to the precision of the source NUMERIC plus the difference between the target scale and the source scale. |