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: How many byte NUMER(19) take?

Re: How many byte NUMER(19) take?

From: Klaus Zeuch <KZeuch_at_nospamhotmail.com>
Date: 2000/08/03
Message-ID: <8mclru$kd3$18$1@news.t-online.com>#1/1

From the manual:

"Internal Numeric Format
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 102, 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). Negative numbers include the sign in their length.

Taking this into account, the column size in bytes for a particular numeric data value NUMBER (p), where p is the precision of a given value, can be calculated using the following formula:

ROUND((length(p)+s)/2))+1

where s equals zero if the number is positive and s equals 1 if the number is negative.

Zero and positive and negative infinity (only generated on import from Version 5 Oracle databases) are stored using unique representations. Zero and negative infinity each require one byte; positive infinity requires two bytes. "

<dominica_at_secondhat.com> schrieb im Newsbeitrag news:8mcl1c$npa$1_at_secondhat.secondhat.com...
> Hi Everyone,
>
>
> Do you know how to calculate
> what is the size of the following record?
>
> For example, number(19) is how many byte???
>
> I know there is a VSIZE command in sqlplus.
> But I would like to calculate if the whole record is FULLY used.
>
> Like field_10 is VARCHAR2(1024), I will assume is actually filled with
> 1024 character.
>
> Thank you in advance,
>
> Please email me directly to dominica_l_at_yahoo.com
>
> after underline is a lowercase L, not a ONE.
>
>
>
> Dominica Leung
>
> a table
> ==============
> FIELD_1 NOT NULL NUMBER(19)
> FIELD_2 NOT NULL NUMBER(19)
> FIELD_3 NOT NULL DATE
> FIELD_4 DATE
> FIELD_5 DATE
> FIELD_6 DATE
> FIELD_7 DATE
> FIELD_8 NUMBER(19)
> FIELD_9 NUNBER(2)
> FIELD_10 VARCHAR2(1024)
>
Received on Thu Aug 03 2000 - 00:00:00 CDT

Original text of this message

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