Hello,
I have XMLType column with below information
id | XMLCOL
------------------------
100 | <DOC_ALERT_ATTRIBUTES>
<DOC_ATTRIBUTE>
<DOC_NAME>Finace_Report.xls</DOC_NAME>
<DOC_ID>1234</DOC_ID>
<DOC_TYPE>Data_Sheet2</DOC_TYPE>
<DOC_LOAD_DT>12 Sep 2009 2.30 PM</DOC_LOAD_DT>
</DOC_ATTRIBUTE>
<DOC_ATTRIBUTE>
<DOC_NAME>Account_Report.xls</DOC_NAME>
<DOC_ID>1235</DOC_ID>
<DOC_TYPE>Data_Sheet1</DOC_TYPE>
<DOC_LOAD_DT>01 Sep 2009 2.30 PM</DOC_LOAD_DT>
</DOC_ATTRIBUTE>
<DOC_ATTRIBUTE>
<DOC_NAME>Marketing_Report.xls</DOC_NAME>
<DOC_ID>1236</DOC_ID>
<DOC_TYPE>Data_Sheet2</DOC_TYPE>
<DOC_LOAD_DT>03 Sep 2009 2.30 PM</DOC_LOAD_DT>
</DOC_ATTRIBUTE>
</DOC_ALERT_ATTRIBUTES>
output required -
id | Value
------------------------
100 |Finace_Report.xls,1234,Data_Sheet2,12 Sep 2009 2.30 PM
100 |Account_Report.xls,1235,Data_Sheet1,01 Sep 2009 2.30 PM
100 |Marketing_Report.xls,1236,Data_Sheet2,03 Sep 2009 2.30 PM
I tried below one -
Select id,EXTRACT (Value,
'/DOC_ALERT_ATTRIBUTES/DOC_ATTRIBUTE'
).getstringval () a
from table_a
where id = 100;
and its giving me the values in one row.
Is there a way to do it in sql with multiple rows?
Regards,
Naveen