Storing NUMBER Data
You can achieve optimal space savings for NUMBER data using either multivalue compression, algorithmic compression, or a combination of both.
NUMBER data is stored as a variable length field from 0 to 18 bytes in width. You can use the NUMBER type to represent both fixed point and floating point decimal numbers, depending on the syntax you use to specify the type. In the following table, the characters p and s represent precision and scale, respectively.
General Type |
Syntax |
Functional Description |
Fixed point
|
NUMBER(p,s) |
Similar to DECIMAL(p,s) |
NUMBER(p) |
Similar to DECIMAL(p) |
|
Floating point
|
NUMBER(*,s) |
Floating point decimal with s fractional digits |
NUMBER |
A floating point number |
|
NUMBER(*) |
Same as NUMBER |
The following table highlights the approximate equivalences/valid substitutions between the fixed and floating point NUMBER types with other exact (fixed point) and approximate (floating point) types.
You can use this NUMBER type … |
Anywhere you can use this data type … |
With a maximum precision of this many digits … |
Fixed point |
|
38 |
Floating point |
|
40 |
Whether a NUMBER type is used to represent a fixed point value or a floating point value, it is stored in the same way and with the same accuracy. See “Floating Point NUMBER Types” on page 729, “Non‑INTEGER Numeric Data Types” on page 731, and SQL Data Types and Literals for more information about the NUMBER type.