Problem Note 62488: Writing numeric values to Oracle might cause precision loss
When you write numeric values to Oracle, you might encounter precision loss.
For example, you might encounter this problem when you perform steps similar to the following:
- Create a table in Oracle named MYDEC.
- Add values (including 104.88) to the table.
- Connect to SAS® Federation Server.
- Run code similar to the following to read a value with type NUMERIC(15,2) from an Oracle database:
libname fedora fedsvr server="server-name" port=24141 user="user-ID"
password="server-password" dsn="oracle-dsn" catalog="catalog-name" schema="schema-name" ;
proc sql ;
drop table fedora.feddec;
create table fedora.feddec as select * from fedora.mydec;
select * from fedora.feddec;
* got value 104.87 ;
quit ;
- Write the value to an Oracle database. The value is stored as 104.87 in the Oracle database.
This loss of precision is typical of floating-point arithmetic. Base SAS® uses an IEEE double format (8 bytes) to save numeric values. This format does not specify exact values, and it supports precision up to 15 digits.
For example, with this format, 104.88 in Oracle might be read into SAS as 104.879999999999995. When writing the SAS value back to Oracle with format NUMERIC(16,2), SAS incorrectly truncates the value to 104.87.
Click the Hot Fix tab in this note to access the hot fix for this issue.
Operating System and Release Information
SAS System | SAS Federation Server | Microsoft® Windows® for x64 | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows 8 Enterprise 32-bit | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows 8 Enterprise x64 | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows 8 Pro 32-bit | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows 8 Pro x64 | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows 8.1 Enterprise 32-bit | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows 8.1 Enterprise x64 | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows 8.1 Pro 32-bit | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows 8.1 Pro x64 | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows 10 | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows Server 2008 | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows Server 2008 R2 | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows Server 2008 for x64 | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows Server 2012 Datacenter | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows Server 2012 R2 Datacenter | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows Server 2012 R2 Std | 4.2 | | 9.4 TS1M3 | |
Microsoft Windows Server 2012 Std | 4.2 | | 9.4 TS1M3 | |
Windows 7 Enterprise 32 bit | 4.2 | | 9.4 TS1M3 | |
Windows 7 Enterprise x64 | 4.2 | | 9.4 TS1M3 | |
Windows 7 Home Premium 32 bit | 4.2 | | 9.4 TS1M3 | |
Windows 7 Home Premium x64 | 4.2 | | 9.4 TS1M3 | |
Windows 7 Professional 32 bit | 4.2 | | 9.4 TS1M3 | |
Windows 7 Professional x64 | 4.2 | | 9.4 TS1M3 | |
Windows 7 Ultimate 32 bit | 4.2 | | 9.4 TS1M3 | |
Windows 7 Ultimate x64 | 4.2 | | 9.4 TS1M3 | |
64-bit Enabled AIX | 4.2 | | 9.4 TS1M3 | |
64-bit Enabled Solaris | 4.2 | | 9.4 TS1M3 | |
HP-UX IPF | 4.2 | | 9.4 TS1M3 | |
Linux for x64 | 4.2 | | 9.4 TS1M3 | |
Solaris for x64 | 4.2 | | 9.4 TS1M3 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
When you write numeric values to Oracle using SAS® Federation Server, you might encounter precision loss from floating-point arithmetic.
Type: | Problem Note |
Priority: | high |
Date Modified: | 2018-07-12 14:36:24 |
Date Created: | 2018-06-19 10:25:59 |