Icon Exact Numeric Types

Exact numeric types are used when you wish to store a numeric value in its exact representation without accumulating rounding errors. Specifically, NUMERIC and DECIMAL types allow you to specify the scale so that any numeric values with a greater scale are automatically rounded to the specified scale using the bankers rounding algorithm, which simply says that any digits past the specified scale are rounded to the specified scale using the following logic:

1) Round towards the nearest integer.

2) If there are two nearest integers, then round the value towards the even integer value.

TypeDescription
INTEGER
INT
A 32-bit,signed integer value
SMALLINTA 16-bit,signed integer value
BIGINTA 64-bit,signed integer value
NUMERIC[(<Precision>[,<Scale>])]A 64-bit exact numeric value a specifc precision and scale, or fractional digits. Regardless of the precision specified, ElevateDB always uses an implementation-defined precision of 19 digits. The maximum scale is 4 digits. This type is ideal for representing monetary values. If the scale is not specified, then the default is 0. If the precision is not specified, then the default is 19 digits.
DECIMAL[(<Precision>[,<Scale>])]An 64-bit exact numeric value a specifc precision and scale, or fractional digits. Regardless of the precision specified, ElevateDB always uses an implementation-defined precision of 19 digits. The maximum scale is 4 digits. This type is ideal for representing monetary values. If the scale is not specified, then the default is 0. If the precision is not specified, then the default is 19 digits.

Literals
Exact numeric literals use the period (.) as the decimal point character, the minus (-) as the negative sign character, the plus (+) as the positive sign character, and scientific notation is not supported.

Literal Examples
-- This example specifies an INTEGER literal

SELECT * FROM Customer WHERE CustNo=1206

-- This example specifies a DECIMAL literal

SELECT * FROM Customer WHERE BalanceDue > 1000.00

SQL 2003 Standard Deviations
The following areas are where ElevateDB deviates from the SQL 2003 standard:

DeviationDetails
NUMERIC TypeElevateDB translates any NUMERIC into the equivalent DECIMAL type. Also, it always uses the implementation-defined precision of 19 digits instead of the precision that is specified in the type definition.
Image