Support Article
Decimal precision lost for number type in oracle
SA-41712
Summary
In Oracle, decimal precision is lost for database columns of type Number. In a financial system, transactions fail and books display incorrect balances.
Error Messages
Not Applicable
Steps to Reproduce
- Upgrade Java version from 6 to 7. Also, upgrade the driver version.
- Upgrade Oracle JDBC driver version to 11.1.0.7.
Root Cause
A defect or configuration issue in the operating environment. Database column is of type Number and does not have the decimal precision specified. Saving to the database column of type Number, truncates the decimals.
Resolution
Make the following change to the operating environment:- Upgrade driver version to Oracle 11.2.0.3.0 or higher.
- With Oracle 11.2.0.3, both saving to number or number (18,2) work correctly.
Published October 15, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.