What column type in Oracle 10g can be used to store any value of java double up to and including Double.MAX_VALUE and Double.MIN_VALUE?
+2
A:
From the Oracle SQL Reference:
The NUMBER datatype stores zero as well as positive and negative fixed numbers with absolute values from 1.0 x 10^-130 to (but not including) 1.0 x 10^126.
It looks like you may need BINARY_DOUBLE:
Maximum positive finite value: 1.79769313486231E+308
Minimum positive finite value: 2.22507485850720E-308
Tony Andrews
2008-11-21 10:48:34
The docs say: "A constant holding the largest positive finite value of type double, (2-2**52)·2**1023". I use ** to mean exponentiation. Entering this expression into Windows calculator gives 1,797693134862315708145274237317e+308.
unwind
2008-11-21 11:08:51
Oracle's BINARY_DOUBLE does not store the IEEE754 value -0, Java does.
MSalters
2008-11-21 12:20:37
What the heck is -0 as opposed to 0? ;-)
Tony Andrews
2008-11-21 12:39:59
I thought that would be it. For some reason I got oracle jdbc driwer
Bloodboiler
2008-11-27 21:31:37
.. to throw an exception when inserting close to max/min values.
Bloodboiler
2008-11-27 21:34:53