Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Storing trailing zeros in mantissa
Noons is correct. Jeff, the difference is purely one of display and not one
of actual percision. If you are using an interface (eg oci, odbc, etc.) tp
retrieve this data it will come back as a number and the added 0 wouldn't
make sense. (it is a number) In sqlplus you will see it depending upon how
you have set your formatting to be, but that has nothing to do with what the
number is.(eg put in a number 10.12345432123 and you will probably get back
a displayed number that displays less percision, but if you use oci etc. you
will retrieve the full percision of the number. You can have the display
display more decimals if you set the numeric format to be larger.) In
short, if your other program wants strings (and not numbers) then I would
still store the number as a number, but just do a
to_char(myColumn,formatMask) to get it to "look right". See SQL Reference
guide for the formatMask that will work for you.
Jim
"Noons" <wizofoz2k_at_yahoo.com.au.nospam> wrote in message
news:3f2a7f6d$0$10357$afc38c87_at_news.optusnet.com.au...
> and if he wants to return it with a
> fixed two decimal, all that's needed
> is a mask function, no?
>
> --
> Cheers
> Nuno Souto
> wizofoz2k_at_yahoo.com.au.nospam
> "Eric Parker" <eric.parkerthedross_at_virgin.net> wrote in message
> news:3GuWa.2608$Kx1.32702_at_newsfep4-glfd.server.ntli.net...
> > "Jeff Turner" <zigjst_at_hotmail.com> wrote in message
> > news:c73aa58a.0308010604.2c1f4ca9_at_posting.google.com...
> > > I have a column defined as NUMBER(18,2) and want to store a value of,
> > > say, "10.20" in this column. Oracle returns the value to me as "10.2"
> > > instead of "10.20", but in my application (scientific in nature) there
> > > is a difference in "10.2" and "10.20".
> > >
> > > After browsing the ng's, it seems this is normal behavior in Oracle...
> > > Is this true? Does anyone know any magical "switches" I can flip to
> > > tell Oracle to store trailing zeros?
> > >
> > > Thanks,
> > > Jeff
> >
> > Jeff
> >
> > If you really need to store and be able to distinguish between 10.2 and
> > 10.20
> > then you will have to store them as VARCHAR2s. As numeric values they
are
> > identical.
> >
> > HTH
> >
> > eric
> >
> > --
> > Remove the dross to contact me directly
> >
> >
>
>
Received on Fri Aug 01 2003 - 10:16:34 CDT