Thursday, March 27, 2008

Counting the number of nodes in an XMLType

Newer Oracle versions can use a function called XMLTable, but <10.2 have to use another method:

select count(*) into number_of_items from table(xmlsequence((the_xml.extract('/*/mynode', 'xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"') )));

No comments:

Labels

Blog Archive

Contributors