Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Design Consideration for Number Column
Hi Jim,
But what is your rationale behind this decision? NUMBER and NUMBER(8,2) can both represents '489.49' . So why bother adding the constraint?
Just like when programming java or C, we would use int or long for numeric values even as simple as a loop counter. We won't bother restricting the max value of our variable.
Thx for any input
"Jim Kennedy" <kennedy-downwithspammersfamily_at_attbi.net> ¦b¶l¥ó
news:VsGdnYCVfuNRhNPfRVn-gg_at_comcast.com ¤¤¼¶¼g...
>
> "dd" <dd_at_dd.com> wrote in message news:424d7051$1_2_at_rain.i-cable.com...
> > Is it a good design to use NUMBER for all numeric columns (vs specific
> > precision, say, NUMBER(8,2))? Is there any real benefit to specify a
> > precision ?
> >
> > I have this problem because Donald Bales in his book Java Programming
with
> > JDBC, Oreilly (chap 10.2) does recommend us defining both Integer and
> > floating point values as NUMBER. I am not sure if JDBC type mapping is
a
> > reason for his recommendation.
> >
> > Thx for any advice
> >
> >
> I would use whatever precision is appropriate for your business needs. (eg
> if you are storing monetary values then perhaps 2 decimal places is
correct.
> if you are storing the number of items in an order then 0 decimal places
is
> correct. and so forth) Use it as a constraint on what the numbers should
> be.
> Jim
>
>
Received on Sat Apr 02 2005 - 04:11:18 CST
![]() |
![]() |