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(p,s)

Re: Number vs. Number(p,s)

From: Hans Forbrich <forbrich_at_telusplanet.net>
Date: Mon, 14 May 2001 07:26:45 GMT
Message-ID: <3AFF89FB.7C2891CF@telusplanet.net>

One reason for specifying scale and precision is to provide CONSTRAINTS - that is business rules. If you know a rule ahead of time (say, the figure is always in millions or the max will never exceed 9999.99) you can enforce that using the scale and precision. Otherwise I find there is minimal disk and memory impact.

You can always increase the size at a later time if you find the rule that was given to you needs to change.

Personal feeling - if you can define the value, code it into the dictionary as documentation at the very least.

/Hans

VWP914 wrote:

> I am trying to decide whether I wan't to use floating point (NUMBER) or fixed
> point
> (NUMBER(p, s)) datatypes for my database design. Apart from having more
> control with the fixed point option, is there any advantage memory wise?
> For instance, if I know that I have a number that will never be greater than,
> say
> 99999.99, should I bother and assign it to NUMBER(7,2), or just go ahead and
> make it a NUMBER with no scale or precision declared?
>
> I just don't see the advantage of specifically declaring a precision and scale,
> when you can just make it a floating point. Especially, when you consider that
> you are making a guess (albeit an edjucated guess) as to the scale and
> precision of you column. If this guess turns out to be incorrect, and say you
> really should have chosen NUMBER(8,2), for example, your application will give
> you an error.
>
> Any advice here would be appreciated.
>
> Thomas
  Received on Mon May 14 2001 - 02:26:45 CDT

Original text of this message

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