Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Fetching multiple values from XML node

arloharNov 26 2008 — edited Feb 10 2009
Hi,

I have the below XML string / Data stored in one of a table column. I am trying to extract the values of ITEM_NAME node. using the query :
select extractvalue(xml_data, '/BILL/BILL_DTL/RECORD/ITEM_NAME') from XMLTable;

If i use this query i am getting the error as : ORA-19025 EXTRACTVALUE returns value of only one node

XML String / XML data
-----
<BILL>
.....<BILL_NO>1000</BILL_NO>
.....<SRNO>3456</SRNO>
.....<BILL_DTL>
........<RECORD>
...........<LINE_NO>1</LINE_NO>
...........<ITEM_NAME>TOYOTA COROLLA</ITEM_NAME>
........</RECORD>
........<RECORD>
..........<LINE_NO>2</LINE_NO>
..........<ITEM_NAME>NISSAN CEDRIC</ITEM_NAME>
.......</RECORD>
.....</BILL_DTL>
</BILL>

The structure of the table is given below.

SQL> DESC XMLTABLE;
Column_Name ---------------Type
DOC_ID -------------------------NUMBER
XML_DATA --------------------XMLTYPE

What will be the query to fetch the values from the ITEM_NAME node.

Thanks & Regards
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 10 2009
Added on Nov 26 2008
4 comments
9,058 views