Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Internal storage numbers
On Sat, 26 Sep 1998 23:40:13 -0400, "David" <dkight_at_ibm.net> wrote:
>I have 2 questions that relate to the number datatype;
>
>1. Do columns number(10) and number use the same amount of internal
>storage?
>2. How storage does number and number(10) use?
>
>Thanks in advance
>
>
Numbers are stored internally in a variable length format, depending
on the number of digits of precision in the number. Number is
equivalent to number(38) so could be larger than number(10) just
because of the number of digits.
From Oracle 8 server concepts:
Oracle stores numeric data in variable-length format. Each value is stored in scientific notation, with one byte used to store the exponent and up to 20 bytes to store the mantissa. (The resulting value is limited to 38 digits of precision.)
Oracle does not store leading and trailing zeros. For example, the number 412 is stored in a format similar to 4.12 x 10^2, with one byte used to store the exponent (2) and two bytes used to store the three significant digits of the mantissa (4, 1, 2). Taking this into account, the column data size for a particular numeric data value NUMBER (p), where p is the precision of a given value (scale has no effect), can be calculated using the following formula:
1 byte (exponent)
+ FLOOR(p/2)+1 bytes(mantissa)
+ 1 byte (only for a negative number where
the number of significant digits is
less than 38)
![]() |
![]() |