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: number vs. number(4)

Re: number vs. number(4)

From: Peter J. Holzer <hjp-usenet_at_SiKitu.wsr.ac.at>
Date: Fri, 26 Jan 2001 22:11:19 +0100
Message-ID: <slrn973pvn.2vc.hjp-usenet@teal.h.hjp.at>

On 2001-01-25 20:18, Howard J. Rogers <howardjr_at_www.com> wrote:
>
>Peter J. Holzer <hjp-usenet_at_SiKitu.wsr.ac.at> wrote in message
>news:slrn970bti.rr.hjp-usenet_at_teal.h.hjp.at...
>> On 2001-01-24 01:38, Howard J. Rogers <howardjr_at_www.com> wrote:
>> >Unqualified number fields are up to 38 digits in length (and hence
>> >approximately 38 bytes variable),
>>
>> Are you sure? The output from dump looks like numbers are stored as
>> variable length objects:
>>

 [...]
>>
>> The number 1 seems to take 2 bytes, and the number 123456789 seems to
>> take 6 bytes. Or am I misinterpreting the dump() function?
>
>
>No, you're just ignoring two key words in my original reply, viz. UP TO 38
>digits in length.

I ignored them because you also wrote that number(4) uses less space in the row than number. So I though you meant "to store up to 38 digits the variable always needs to occupy 38 bytes"[1]. That was obviously a misunderstanding, sorry. However, if a number is stored as variable length anyway, the space savings from declaring it as number(4) instead of number(38) are probably zero and in any case very small. Looks more like documentation to me.

        hp

[1] actually a decimal digit should only take a little over 3 bits.

-- 
   _  | Peter J. Holzer    | All Linux applications run on Solaris,
|_|_) | Sysadmin WSR       | which is our implementation of Linux.
| |   | hjp_at_wsr.ac.at      | 
__/   | http://www.hjp.at/ |	-- Scott McNealy, Dec. 2000
Received on Fri Jan 26 2001 - 15:11:19 CST

Original text of this message

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