Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Datatype numeric
Try to resolve the mystery for you...
If all is well (and I don't have docs at home) you should have the columns
scale and precision in user_tab_columns. They definitely exist in
dba_tab_columns. That are the columns you should be using for space
calculation of numeric data.
All numeric data are stored as packed decimal (two digits in one byte) plus
a sign byte, plus a length byte, hence the maximum length of 22. (I know the
max scale is 38, and sorry enough I don't have an explanation for that). So
a number 10 is taking 5 bytes + sign byte + length byte. This also means
there is no good reason for using number 9 or 11, because you will be
wasting space then.
Hth,
Sybrand Bakker, Oracle DBA
nieuws net wrote in message <7g40k8$hhb$1_at_zonnetje.NL.net>...
>Hi all
>
>when i create a table with datatype numeric (it does not matter how long)
>and when i select the view user_tab_columns
>i see that all columns with datatype numeric are 22 bytes long.
>When i try to size a table with those data , i reserve too much space.
>
>who can help
>
>gkor_at_rdw.nl
>
>
Received on Tue Apr 27 1999 - 13:12:01 CDT