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!

Convert CLOB to XMLType in SELECT statement ?

alpicusFeb 5 2007 — edited Feb 5 2007
Hi XML Xperts,

In my Oracle 9.2.0.3 I have 1 table (tab1) with 2 cols (col1 as XMLType and col2 as CLOB). I Inserted in both fields the following same XML data :

<?xml version="1.0"?>
<TABLE_NAME>MY_TABLE</TABLE_NAME>


With the following statement, I can get the data from col1 which is a XMLType column :

SELECT a.col1.extract('//TABLE_NAME/text()').getStringVal() AS "Table Name"
FROM tab1 a
WHERE a.col1.existsNode('/TABLE_NAME') = 1;


How to get the same data FROM col2 whcih is a CLOB column ? Is it possible to transform the CLOB to XMLType in the SELECT statement ?

Note : I cannot change the type of the colulmn col2 to XMLType

Thanks in advance.

Phil
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 5 2007
Added on Feb 5 2007
2 comments
9,964 views