Skip to Main Content

Database Software

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!

Count XML nodes

763856Jun 1 2010 — edited Jun 4 2010
Hello community,

I'm very new here and need your help:

What I have is an XML file in a table named "table_xml" with a column named "xml_file". The XML file looks like:

<head>
<row>...</row>
<row>...</row>
<row>...</row>
<row>...</row>
</head>

What I am trying to do is to count the XML nodes named "row". I use the 11g version of Oracle and it seems like I have to manage that with XMLTABLE, but I fail trying this. Could anyone please show me how to do that?


What could have work with former versions is:
SELECT count('/*/row')
FROM table_xml t , TABLE(XMLSequence(extract(t.xml_file,'/*/row'))) v


Thank you a lot in advace!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 2 2010
Added on Jun 1 2010
6 comments
4,323 views