Skip to Main Content

DevOps, CI/CD and Automation

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

XMLtype to CLOB conversion

Azhar HusainMar 11 2010 — edited Mar 12 2010
Hi Gurus,

I am trying to convert XML file stored into XMLtype datatype into CLOB through getClobVal function but its not able to write complete text (which is around 1 MB ) into CLOB. When I am checking my XML file after conversion the TEXT tag is not same as it was in the original XML file. In other words-

I have a table TEST_TABLE(TEST_COL XMLtype)
I wrote following function(just pasting the part of code, though I can use getclobval() directly into query) to convert XML store into TEXT_TABLE

CREATE OR REPLACE FUNCTION getvalue_clob_post(p_xmldata XMLtype)
RETURN clob IS
v_xmldata XMLtype;
BEGIN
v_xmldata:=p_xmldata;
RETURN v_xmldata.getClobVal();
EXCEPTION WHEN OTHERS THEN
raise_application_error (-20102, 'Exception occurred in getAccountsHTML :'||SQLERRM);
END getvalue_clob_post;
/

My problem is that I dont want to use getClobVal() becuase it is not working for the tags which contains very large text or different character set.
Does any one has any idea how I can convert data(XML files) stored into XMLtype column into CLOB without using getClobVal() function?
thanks in advance

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 9 2010
Added on Mar 11 2010
3 comments
116,980 views