Copy link to clipboard
Copied
Hi All,
I have an issue storing numbers in oracle 11g. I can pass numbers with no decimals and with decimals, in my data table i see this:
1.1 (OK)
1.2000000000000002 (instead of 1.2)
1.3000000000000003 (instead of 1.3)
1.4000000000000004 (instead of 1.4)
1.5000000000000004 (instead of 1.5)
1.6000000000000005 (instead of 1.6)
1.7000000000000006 (instead of 1.7)
1.8000000000000007 (instead of 1.8)
1.9000000000000008 (instead of 1.9)
2.000000000000001 (instead of 2.0)
I am using this in cfc:
<cfstoredproc procedure="myDB.myPackage.updateTableA" datasource="mySource">
<cfprocparam value="#arguments.myNumberValue#" cfsqltype="cf_SQL_FLOAT">
</cfstoredproc>
In oracle I have the parameter myNumberValue as number data type.
I try CF_SQL_DECIMAL and cf_SQL_NUMERIC, it doesn't pass anything.
What sql type do I use in my storedproc ?
Thanks
Johnny
I'd use CF_SQL_DECIMAL, just make sure you set the SCALE="" attribute to dictate how many decimal places to send.
Copy link to clipboard
Copied
I'd use CF_SQL_DECIMAL, just make sure you set the SCALE="" attribute to dictate how many decimal places to send.
Copy link to clipboard
Copied
Ok, but the number can change, it can be 2,3,4, 3.2, 4.23, 5.232123.
It is a way to handle this?
Thanks
johnny
Copy link to clipboard
Copied
Yes, if I set the scale to 15 it will store any number with decimals fine.
Thanks!!!
Johnny
Copy link to clipboard
Copied
It sure will