Fixed-decimal Data Types

From InterBase
Jump to: navigation, search

Go Up to Defining Numeric Data Types


InterBase supports two SQL data types, NUMERIC and DECIMAL, for handling numeric data with a fixed decimal point, such as monetary values. You can specify optional precision and scale factors for both data types. These data types are also referred to as exact numerics.

  • Precision is the total number or maximum number of digits, both significant and fractional, that can appear in a column of these data types. The allowable range for precision is from 1 to a maximum of 18.
  • Scale is the number of digits to the right of the decimal point that comprise the fractional portion of the number. The allowable range for scale is from zero to precision; in other words, scale must be less than or equal to precision.

The syntax for NUMERIC and DECIMAL is as follows:

NUMERIC[(precision [, scale])]
DECIMAL[(precision [, scale])]

You can specify NUMERIC and DECIMAL data types without precision or scale, with precision only, or with both precision and scale.

Topics