Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with Float data type
> 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).
-- NoelReceived on Mon Apr 11 2005 - 04:40:12 CDT