Feedback
Did this article resolve your question/issue?

   

Article

Salesforce driver rounds some larger values of CURRENCY, NUMBER and PERCENT type

Information

 
TitleSalesforce driver rounds some larger values of CURRENCY, NUMBER and PERCENT type
URL Namethe-driver-incorrectly-rounded-some-larger-values-of-the-currency-data-type
Article Number000158882
EnvironmentProduct: Connect64E for ODBC Salesforce driver and Connect for JDBC Salesforce driver
Version: 7.1 (ODBC) and 5.1(JDBC)
OS: All supported platforms
Database: Salesforce
Application: All supported applications.
Question/Problem Description
The Connect for ODBC Salesforce driver incorrectly rounds some larger values of the CURRENCY, NUMBER and PERCENT data types.
The Connect for JDBC Salesforce driver incorrectly rounds some larger values of the CURRENCY, NUMBER and PERCENT data types.
Steps to ReproduceCreate a custom field of type CURRENCY in salesforce.
Insert the value as 9999999999999998

Connect to Salesforce using ConnectXE for ODBC Salesforce driver and execute the following query to select this value.

Select CURRENCY__C from sforce.campaign
CURRENCY__C
10000000000000000

-----------------------------
Add a NUMBER(18,0) column NUMBER_TEST to an existing Salesforce object, such as ACCOUNT.

SQLPrepare:
insert into ACCOUNT (NUMBER_TEST) values (?)

Bind value 144115188075855872 as follows:
odbct32w 3ff4-4004 EXIT SQLBindParameter with return code 0 (SQL_SUCCESS)
HSTMT 0x00227508
UWORD 1
SWORD 1 <SQL_PARAM_INPUT>
SWORD 1 <SQL_C_CHAR>
SWORD 8 <SQL_DOUBLE>
SQLULEN 18
SWORD 0
PTR 0x00A10000
SQLLEN 26
SQLLEN * 0x00E50000 (-3)

SQLExecute

In the Salesforce UI, the inserted value shows as 144115188075855792.
Clarifying Information
Error MessageIn some instances the following error message may be displayed:
[DataDirect][SForce JDBC Driver][SForce]Keyword not supported: currencydescribetype
Defect NumberDefect XDBC-4409
Enhancement Number
Cause
The Salesforce driver by default treats the CURRENCY, NUMBER, and PERCENT types as type double. With currency, percent, and number types supporting up to 18 digits, this exceeds the precision of a double and results in rounding off some values.
Resolution
Fixed in hot fix 07.16.0233 (ODBC) and JDBC 5.1.4.000198 (JDBC) 

Refer to  Connect and Connect64 for ODBC hot fix download and install instructions for instructions on how to download and install the hot fix.
Refer to  Connect for JDBC hot fix download and install instructions for instructions on how to download and install the hot fix.

This fix also requires a hidden connection option. Contact Technical Support for additional information. 
Workaround
Notes
Last Modified Date11/20/2020 7:14 AM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.