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 bytes does the number data type take internally?

Re: How many bytes does the number data type take internally?

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Mon, 12 Jul 1999 21:58:44 +0800
Message-ID: <3789F494.65C@yahoo.com>


Eric wrote:
>
> How do you calculate it?
>
> Thank you

Check server concepts 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. (However, there are only 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 10^2, 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). Taking this into account, the column data size for a particular numeric data value NUMBER (p), where p is the precision of a given value (scale has no effect), can be calculated using the following formula:

  1 byte			(exponent) 
  FLOOR(p/2)+1 bytes	(mantissa) 
+ 1 byte			(only for a negative number where
					the number of significant digits is
					less than 38) 
_______________________    

number of bytes of data
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, while positive infinity requires two bytes.

--



Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Mon Jul 12 1999 - 08:58:44 CDT

Original text of this message

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