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: Problem with Oracle float type

Re: Problem with Oracle float type

From: Mike Krolewski <mkrolewski_at_rii.com>
Date: Thu, 28 Dec 2000 17:53:37 GMT
Message-ID: <92fumu$kr3$1@nnrp1.deja.com>

In article <92ead4$dvp$1_at_nnrp1.deja.com>,   daning_at_my-deja.com wrote:
> Sorry for something is not clear. I can display the correct data by
> setting "Col A format ..." in SQL plus. the real problem is I use ADO
> to access the the table, and ADO could only get value as 2.30.
>
> maybe here is not the right place to post this question.
>
> In article <92e3oc$8sd$1_at_nnrp1.deja.com>,
> daning_at_my-deja.com wrote:
> > Hi all,
> >
> > I got a problem when insert data to a column with float data type,
 here
> > is my steps.
> >
> > 1. create table m_test (a float);
> >
> > 2. insert into m_test values(2.2999999999999998);
> >
> > 3. select * from m_test;
> >
> > this is what I got
> >
> > A
> > ----------
> > 2.3
> >
> > I dont want Oracle server displays this value to me, I need the
 value
> > 2.2999999999999998, which has been inserted. I believe that the
> > 2.2999999999999998 has been stored in the database. because if you
 do
> > select * from m_test where a=2.3, you get nothing. It looks weird.
 Does
> > anybody have idea?
> >
> > I am running Oracle 8.1.6 on NT.
> >
> > thank you in advance.
> >
> > daning
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
> Sent via Deja.com
> http://www.deja.com/
>

You might try REAL datatype : basically a double precision float or NUMBER(128) in Oracle. Whether ADO handle the number the same is a question.

A question to you, why do you want to track to 16 digits to the right of the decimal? Very few operations can generate information that is that significant. You might want to reassess what it is that you are doing.

This is sorta like the problem of moving from slide rules to calculators. (am i that old?) Just because the number is displayed does not increase your precision or significance. Often 4 or 5 digits are as good as you are going to get.

--
Michael Krolewski
Rosetta Inpharmatics
mkrolewski_at_rii.com
              Usual disclaimers


Sent via Deja.com
http://www.deja.com/
Received on Thu Dec 28 2000 - 11:53:37 CST

Original text of this message

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