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!

Need help how to read xml data stored in blob column

Jason S-Uk-OracleNov 24 2014 — edited Nov 25 2014

Hi,

I have loaded an xml file into a column (xmlname) in a table (customer).  I'm been Googling around trying to teach myself how to read back the xml data.  I've come across various posts but the common theme is to convert the blob to a clob!

Is this the correct approach and if so how do you convert a blob to a clob?

Then how do you construction an sql statement to read back the xml data (for example the /ruleServiceReport/hostId)?

select * from customer

161TEST[unsupported data type]

Column NameData TypeNullableDefaultPrimary Key
IDNUMBERNo-1
CUSTOMERNAMEVARCHAR2(250)Yes--
XMLNAMEBLOBYes--

snippet of xml data stored:

<ruleServiceReport xmlns="http://blahblahblah">

<jobRequestId>
1416140692864

</jobRequestId>

<hostId>

12344567

</hostId>

<analysisDate>

date

</analysisDate>

<reportType>

Report

</reportType>

<bestPracticeReport xmlns:ns2="http:/blahblahblah">

<ns2:extractor/>

<ns2:parser/>

<ns2:ruleServiceInfo/>

<ns2:customerInfo>

<ns2:customerName>
Mr Customer

</ns2:customerName>

<ns2:fullName/>

<ns2:userEmail/>

I'm using APEX and the following:

BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

Any help would be appreciated.

Jason

This post has been answered by odie_63 on Nov 24 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 23 2014
Added on Nov 24 2014
3 comments
2,759 views