Convert CLOB to XMLType in SELECT statement ?
alpicusFeb 5 2007 — edited Feb 5 2007Hi 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