1 Reply Latest reply: Apr 21, 2010 3:48 PM by Mark Williams-Oracle RSS

    NUMBER (*,0) size in bytes

      hi friends

      My numeric fields are all declared as NUMBER (*, 0) which I understand would be the equivalent to number (38).

      I wonder if by declaring the field with the greatest precision ( 38) oracle reserves the maximum space for the field (to store 38 digits, 21 bytes) or that the storage size is variable and that number 38 only represents a maximum boundarie of the field??

      It is important for me because it would be great to save space by stating my keys only as number (10) (which is what I need for now) for example.

      In summary,
      For example: if I have the 2589 in a field number type NUMBER (38), it uses space as a number with 38 digits? or Oracle just uses the space needed? (Which would be equivalent to a 4 digit number (length of 2589))?

      thanks in advance
        • 1. Re: NUMBER (*,0) size in bytes
          Mark Williams-Oracle

          Oracle stores numbers in a varying width format. You can find some details on this format in the documentation here:


          Do a search for "Internal Numeric Format" to find the section.

          You may also find Steve Adams' write up "Internal representation of the NUMBER datatype" to be interesting:


          You can see how your specific example (2589) is converted into Oracle's internal format as follows:
          SQL> select dump(2589) from dual;
          Typ=2 Len=3: 194,26,90
          1 row selected.