Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Number vs. Number(p,s)
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