I have an XML as follows:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<EXPORT>
<DATA>
<Row>
<Col>0</Col>
<Col>COMP-00001</Col>
<Col>rg</Col>
<Col>Preliminary</Col>
<Col/>
<Col>COMP - Crystal</Col>
</Row>
<Row>
<Col>0</Col>
<Col>COMP-00004</Col>
<Col>Test1</Col>
<Col>Preliminary</Col>
<Col>A</Col>
<Col>COMP - Crystal</Col>
</Row>
<Row>
<Col>0</Col>
<Col>COMP-00016</Col>
<Col>Test123</Col>
<Col>Released</Col>
<Col>A</Col>
<Col>COMP - Crystal</Col>
</Row>
</DATA>
</EXPORT>
How can I extract data from such format of XML. I have been trying the following code, but it does not seem to work
SELECT vt.COL_v1
FROM XML_REPOSITORY_TAB fm
, XMLTABLE('*'
PASSING fm.XML_DATA
COLUMNS
xmlresult XMLTYPE PATH '/EXPORT/DATA'
) xt
, XMLTABLE('*'
PASSING xt.xmlresult
COLUMNS
COL_v1 VARCHAR2(100) PATH 'Col/text()'
) vt
where fm.id= 1
Can anybody tell me, what and where I am doing it wrong.