Skip to main content
Inspiring
October 14, 2011
Answered

Issue passing numbers in store procedure

  • October 14, 2011
  • 1 reply
  • 946 views

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

    This topic has been closed for replies.
    Correct answer Owainnorth

    I'd use CF_SQL_DECIMAL, just make sure you set the SCALE="" attribute to dictate how many decimal places to send.

    1 reply

    Owainnorth
    OwainnorthCorrect answer
    Inspiring
    October 14, 2011

    I'd use CF_SQL_DECIMAL, just make sure you set the SCALE="" attribute to dictate how many decimal places to send.

    jfb00Author
    Inspiring
    October 14, 2011

    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