Using DBMS_XMLDOM.WRITETOCLOB with an EMPTY_CLOB Errors (Doc ID 578703.1)

Last updated on FEBRUARY 08, 2017

Applies to:

Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 11.1.0.7 - Release: 10.2 to 11.1
Information in this document applies to any platform.

Symptoms

Using DBMS_XMLDOM.WRITETOCLOB with an EMPTY_CLOB results in:

10.2
====
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at "XDB.DBMS_XMLDOM", line 4442
ORA-06512: at "XDB.DBMS_XMLDOM", line 4462
ORA-06512: at line 6

11.1
====
ERROR at line 1:
ORA-31020: The operation is not allowed, Reason: Invalid pl/sql lob locator
ORA-06512: at "XDB.DBMS_XMLDOM", line 5309
ORA-06512: at "XDB.DBMS_XMLDOM", line 5334
ORA-06512: at line 6


.The behavior can be reproduced with the following code:

declare
v_clob CLOB:=empty_clob();
v_doc dbms_xmldom.DOMDocument;
begin
v_doc := dbms_xmldom.newDOMDocument(XMLType('<test>lol</test>'));
dbms_xmldom.writeToClob(v_doc, v_clob);
end;
/


This behavior may also occur wtih DBMS_XSLPROCESSOR.

Changes

This behavior may be noticed as a result of an upgrade, as the same code worked in 9.2.

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