Skip to Main Content

SQL & PL/SQL

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!

conversion of a Base64EncodedXML CLOB to XMLTYPE

Keith JamiesonJul 24 2008 — edited Jun 28 2011

I have an xml file which is base64 encoded and the base64 encoded file is stored as a clob. I want to do all the manipulation in PL/SQL and modify the clob column with one of xmltype

Heres the steps I've got so far:

i) convert the clob to a blob using dbms_lob.converttoclob
ii) Since this is now in binary format I'm asusming that I don't need to cast to raw
iii) decode the binary file using UTL_ENCODE.base64_decode 
iv) add an additional column  temp_xml as type xml_type
v) update the temp_xml column with the values of the original column.
 update <tablename>
               set temp_xml = xmltype(orig_clob_column)

vi) At this stage I will see if I can read the xml in the new column and if all is successful, I will drop the orig_clob_column and rename temp_xml to orig_clob_column.

If I've missed anything or anyone's got some gotchas for me, it would be appreciated.

Message was edited by:
Keith Jamieson

Message was edited by:
Keith Jamieson

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 26 2011
Added on Jul 24 2008
16 comments
5,527 views