Link to home
Start Free TrialLog in
Avatar of bilpar
bilparFlag for United States of America

asked on

Orcale dbms_xmldom.writetobuffer() help

Dear Experts,
After successfully loading an XML file (6MB) into a dbms_xmldom.DOMDocument var (and dbms_xmldom.DOMNode var) I attempt to convert the Node into an XMLType using a two step process.
Step 1 - Call dbms_xmldom.writetobuffer(p_node, l_clob)
Step 2 - Call sys.xmltype.createXml(l_clob)

For small files both steps execute without error.  However, for larger files I get an error on Step 1 - Call dbms_xmldom.writetobuffer(p_node, l_clob).  Here's the error, "ORA-30185: output too large to fit in the buffer".  

The purpose for converting the NODE to an XMLTYPE is to save the data into a XMLTYPE table column.  Can anyone offer a suggestion on how to work around this?

Thanks.
function ToXmlType_
(
    p_node          in      dbms_xmldom.DOMNode
)
return sys.xmltype as
    l_xml           sys.xmltype;
    l_clob          clob;
begin
    dbms_xmldom.writetobuffer(p_node, l_clob);
    return sys.xmltype.createXml(l_clob);
end ToXmlType_;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of bilpar
bilpar
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial