Decimal Issue While Loading Xml File (Doc ID 1418648.1)

Last updated on MARCH 11, 2012

Applies to:

Oracle Server - Enterprise Edition - Version: 11.2.0.2 and later   [Release: 11.2 and later ]
Information in this document applies to any platform.

Symptoms

Loading XML file into database using the Dbms_XMLSave.
XML file contains the decimal numbers with 13 digits after decimal point.
Dbms_XMLSave rounds the value after 5th decimal place.


CREATE TABLE Test(COL1 NUMBER(26,14), COL2 NUMBER(26,14));

DECLARE
insCtx DBMS_XMLSave.ctxType;
rows number;
xmlDoc CLOB := '
<ROWSET><ROW>
<COL1>123456789012.1234567890123</COL1>
<COL2>123456789099.9934567890123</COL2>
</ROW></ROWSET>';
BEGIN
insCtx := DBMS_XMLSave.newContext('TEST');
rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc);
DBMS_XMLSave.closeContext(insCtx);
END;
/


column COL2 format 9999999999999.9999999999999
column COL1 format 9999999999999.9999999999999

SQL> Select * from test;

COL1 COL2
---------------------------- ----------------------------
123456789012.1234600000000 123456789099.9934500000000

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms