Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Design Consideration for Number Column

Re: Design Consideration for Number Column

From: dd <dd_at_dd.com>
Date: Sat, 2 Apr 2005 18:11:18 +0800
Message-ID: <424e6fc6$1_1@rain.i-cable.com>


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> bl 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

Original text of this message

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