Numeric types
- Numeric type overview
Numeric types include the following types, which provide storage of varying sizes.
- Numeric type promotion in expressions
In expressions that use only integer types, Derby promotes the type of the result to at least INTEGER. In expressions that mix integer with non-integer types, Derby promotes the result of the expression to the highest type in the expression.
- Storing values of one numeric data type in columns of another numeric data type
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.
- Scale for decimal arithmetic
SQL statements can involve arithmetic expressions that use decimal data types of different precisions (the total number of digits, both to the left and to the right of the decimal point) and scales (the number of digits of the fractional component).