| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Insert a NaN and fetch in Oracle 8.1.7 on Solaris 2.7
I have a business requirement that we have to insert NaN (Not a
Number) into oracle db. I tried to use Oracle JDBC drivers (both OCI8
and Thin), but I always got 0...
create table mytest (
name varchar2(15),
rate number);
In Java code:
PreparedStatement ps = connection.prepareStatement("insert into
mytest(name, rate) values (?, ?)");
ps.setString(1, "XYZ");
ps.setDouble(2, Double.NaN);
ps.execute();
I selected using SQLPLUS and JDBC, the value for rate is always 0.
When I use C++ and RougeWave SourcePro, NaN is inserted successfully. But SQL*Plus hangs when selecting, and C++/RougeWave gives -0.010101 when selecting.
Anyone has any info about NaN? Thanks.
![]() |
![]() |