Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Datatype numeric

Re: Datatype numeric

From: Nieuws <gkor_at_rdw.nl>
Date: Tue, 27 Apr 1999 22:51:14 +0200
Message-ID: <7g581r$127$1@zonnetje.NL.net>


according to oracle support, the space of the field is calculated dynamically when this field will be filled. could a workaround be as following

numeric(5) size as maximum 5 bytes ?
numeric(9) size as maximum 9 bytes ?

i know it will be too much in some cases but is this a safe method to size numeric fields?

Sybrand Bakker heeft geschreven in bericht <925236576.11262.0.rover.d4ee154e_at_news.demon.nl>...
>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 - 15:51:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US