I have a table holding an xmlstructure
create table xml_stg_test (rawdata xmltype);
insert into xml_stg_test (rawdata) values (xmltype.createxml('<root>
<tmp1>
<val1>123</val1>
</tmp1>
<tmp1>
<val1>234</val1>
<tmp2>
<val2>567</val2>
</tmp2>
</tmp1>
</root>'));
Select extractvalue(value(rec), '*/val1') test
from xml_stg_test sg, table(xmlsequence(extract(rawdata,'*/tmp1'))) rec;
**TEST**
1 123
2 234
I wish to only return the node which does not have child node <tmp2> (i.e row 1). Is this possible to achieve via query? Perhaps by use of member function existnode?
Thanks!