Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to use DBMS_XMLDOM.SETNODEVALUEASCHARACTERSTREAM ?

834081Jun 29 2012 — edited Jun 30 2012
I am trying to create an xml document using XML_DOM and then insert the xmltype into a table. The text of one of the nodes needs to be a CLOB. I have tried this:


v_cf_node := xmldom.makeNode(v_doc);
v_cf_elem := xmldom.createelement(v_doc,'TEMPID');
-- v_cf_node := xmldom.appendChild( v_main_node, xmldom.makeNode(v_cf_elem));
v_text_Stream := DBMS_XMLDOM.SETNODEVALUEASCHARACTERSTREAM (v_cf_node);

WHILE (v_pos) <= dbms_lob.getlength(v_value) LOOP
DBMS_LOB.READ(v_value,v_amt,v_pos,v_buffer);
v_text_stream.write(v_buffer,v_pos);
v_pos := v_pos + LENGTH(v_buffer);
END LOOP;

I have tried numerous things commenting out makeNode causes :
ORA-31020: The operation is not allowed, Reason: Null stream handle
ORA-06512: at "XDB.DBMS_XMLDOM", line 2067
ORA-06512: at "XDB.DBMS_XMLDOM", line 2111
ORA-06512: at "SYS.XMLCHARACTEROUTPUTSTREAM", line 29
ORA-06512: at line 75


leaving it in causes :
ERROR at line 1:
ORA-30994: Invalid argument for DOM stream
ORA-06512: at "XDB.DBMS_XMLDOM", line 2053
ORA-06512: at "SYS.XMLCHARACTEROUTPUTSTREAM", line 6
ORA-06512: at "XDB.DBMS_XMLDOM", line 1692
ORA-06512: at line 71


what am i doing wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2012
Added on Jun 29 2012
1 comment
729 views