Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Issue passing numbers in store procedure

Advisor ,
Oct 14, 2011 Oct 14, 2011

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

818
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Oct 14, 2011 Oct 14, 2011

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

Translate
Guide ,
Oct 14, 2011 Oct 14, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Oct 14, 2011 Oct 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Oct 14, 2011 Oct 14, 2011

Yes, if I set the scale to 15 it will store any number with decimals fine.

Thanks!!!

Johnny

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 16, 2011 Oct 16, 2011
LATEST

It sure will

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources