I am looking for Oracle query which can be run on a table that has one of the column storing XML's This query should dynamically take the xpath in the query to extract the string from all nodes. I have tried below but i have to hardcode the xpath. I do not want to hardcode the xpath.
Is there a way to generate the xpath, based on the structure of XML(structure may vary) on the fly to extract the xml node value?
Output i need is the extracted value of the xml node.
I tried:
SELECT xmltype(XMLCOLUMN).EXTRACT('/report/fulcriteria/text()'),
xmltype(XMLCOLUMN).EXTRACT('/report/conumb/text()'),
xmltype(XMLCOLUMN).EXTRACT('/report/dup/text()'),
xmltype(XMLCOLUMN).EXTRACT('/report/reportdup[1]/dupsource/text()'),
xmltype(XMLCOLUMN).EXTRACT('/report/reportdup[2]/dupsource/text()'),
xmltype(XMLCOLUMN).EXTRACT('/report/reportdup[2]/dupnumb/text()'),
xmltype(XMLCOLUMN).EXTRACT('/report/reportdup[3]/dupsource/text()'),
xmltype(XMLCOLUMN).EXTRACT('/report/reportdup[3]/dupnumb/text()') .
xmltype(XMLCOLUMN).EXTRACT('/report/final/dup/text()'),
FROM MYTABLE