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: Howard J. Rogers <howardjr_at_www.com>
Date: Fri, 26 Jan 2001 07:18:37 +1100
Message-ID: <3a708c02$1@news.iprimus.com.au>

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:
>
> SQL> desc foo
> Name Null? Type
> ----------------------------------------- -------- -----------
> I NUMBER(38)
>
> SQL> select i from foo;
>
> I
> ----------
> 1
> 123456789
>
> SQL> select dump(i) from foo;
>
> DUMP(I)
> ---------------------------------------------------------------------
> Typ=2 Len=2: 193,2
> Typ=2 Len=6: 197,2,24,46,68,90
>
>
> 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. Numbers are indeed variable length fields, which is why no matter how hard you try only ever to use CHAR character types, you still have to worry about PCTFREE and row migration.

Regards
HJR
>
> hp
>
>
> --
> _ | 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 Thu Jan 25 2001 - 14:18:37 CST

Original text of this message

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