An attempt to put a floating-point type of a larger storage size into a location of a smaller size fails only if the value cannot be stored in the smaller-size location.

For example:

create table mytable (r REAL, d DOUBLE PRECISION, i INTEGER, de DECIMAL);0 rows inserted/updated/deletedINSERT INTO mytable (r, d) values (3.4028236E38, 3.4028235E38);ERROR 22003: The resulting value is outside the range for the data type REAL.

You can store a floating-point type in an INTEGER column; the
fractional part of the number is truncated. For example:

INSERT INTO mytable (i) VALUES (1.09e0);1 row inserted/updated/deletedSELECT i FROM mytable;I --------------- 1

Integer types can always be placed successfully in approximate numeric values, although with the possible loss of some precision.

Integers can be stored in decimals if the DECIMAL precision is
large enough for the value. For example:

INSERT INTO mytable (de) VALUES (55555555556666666666);ERROR 22003: The resulting value is outside the range for the data type DECIMAL/NUMERIC(5,2).

An attempt to put an integer value of a larger storage size into
a location of a smaller size fails if the value cannot be stored in the smaller-size
location. For example:

INSERT INTO mytable (i) VALUES 2147483648;ERROR 22003: The resulting value is outside the range for the data type INTEGER.

Note: When truncating trailing digits from a NUMERIC value, Derby rounds down.