Re: Size of datatype NUMBER
Date: Wed, 25 Feb 2009 12:54:24 -0800 (PST)
On Feb 25, 9:56 am, "gym dot scuba dot kennedy at gmail" <kenned..._at_verizon.net> wrote:
> "Norbert Pürringer" <thalio..._at_graffiti.net> wrote in message
> news:35dce30e-e971-4d23-97e3-bd0e07c18177_at_v15g2000yqn.googlegroups.com...> Hello,
> > what is the size of the Oracle datatype NUMBER in bytes?
> > Thank you,
> > Norbert
> It depends on the number. It can be as large as 22 bytes. In Oracle numbers
> are stores in base 100 so a good approximation is logbase10(the number)/2 +1
> . Numbers are internally expressed in scientific notation so 1,000,000,000
> isn't much larger than 10 in terms of storage. You can be empirical about
> it using vsize eg select vsize(mynumbercolumn) from mytable;
I have always just used the formula published by Oracle to approximate the internal storage needed for a numeric value: round((( length((p) + s) / 2)) + 1 where s = 0 for a positive number and 1 for a negative number
Note that powers of 10, that is, 100, 1000, 10000, 1000000 etc just need to increase the exponent.
HTH -- Mark D Powell -- Received on Wed Feb 25 2009 - 14:54:24 CST