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 Float data type

Re: Problem with Float data type

From: Noel <tbal_at_go2.pll-l>
Date: Mon, 11 Apr 2005 11:40:12 +0200
Message-ID: <d3dgn8$lrs$1@inews.gazeta.pl>


> Hi Experts,
> I am facing insert problem with float data field of oracle.
> I have a table having a field with float(126) data type.
> I am inserting data using OLEDB programming.
> The problem is that the exact data that i am inserting is not storing
> in the database.
> If I insert 8.4 through OLEDB programming,it is storing in the database
> as 8.400000000000004.
> If I insert 8.4 through sql plus and read through OLEDB programming it
> is coming as 8.400000000000004.
>
> Why is this happenning? i want the exact data

Its your OLEDB program tool fooling you, i'm affraid. You didn't mention Oracle version anyway, that's may be important.

create table numbers
(
  num1 number(38),
  num2 number(10,2),
  num3 float(126)
  );
insert into numbers values(8.4, 8.4, 8.4); commit;
select * from numbers;

Done it with sql*plus and i got exact 8.4 (first column got rounded, and there is 8 only).

-- 
Noel
Received on Mon Apr 11 2005 - 04:40:12 CDT

Original text of this message

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