I have an XML that looks like below,
<email_details> <VENDOR_ID>73</VENDOR_ID> <RGP_NUMBER>1234</RGP_NUMBER> ..... ..... (any number of Child Elements) </email_details>
The '...' means that there can be other child nodes inside in future.
I have a requirement in which I have to loop through and extract the "node names" and value from all these child nodes in Oracle 10G.
Select xmltype('<ROOT><A><B>2</B><C>3</C><D>4</D></A></ROOT>').extract('ROOT/A/*').getrootelement() From dual;
SELECT * FROM XMLTable('ROOT/A/*' passing xmltype('<ROOT><A><B>2</B><C>3</C><D>4</D></A></ROOT>') columns node_name varchar2(30) path 'name(.)' , node_value varchar2(30) path '.' ) ;
gives me the solution but it is not working in 10G. Please help.