Link to home
Start Free TrialLog in
Avatar of Amol Thakare
Amol Thakare

asked on

i am not able to read the above xml path in plsql

we need to extract value from below xml tag

select extractValue(value(vy), '//NARRATIVE/NA_LOAD_DT') dateloaded,
                               extractValue(value(vy), '//NARRATIVE/NA_LOADED_BY') loadedby,
                               extractValue(value(vy), '//NARRATIVE/NA_TYPE') nartype,
                               extractValue(value(vy), '//NARRATIVE/NA_TEXT') text
                          from table(XMLSequence(Extract(lx_xml,
                                                         '//RESPONSE/MESSAGE/ITEM/RSP_REPORT/CONSUMER/NARRATIVES/NARRATIVE type="M"'))) vy)
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

I would suggest NOT using extractvalue.  Those functions have been deprecated.  I would use XMLTABLE.

If you can provide some sample XML and the expected results, we can help with the SQL.

Here is a pretty basic example I answered yesterday:
https://www.experts-exchange.com/questions/29115576/Extract-a-substring-from-xml-column-from-SQL-query-resultset.html
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.