I'm trying to determine whether an xml tag has two specific child tags.
The XML Clob has a format like this:
<ProductS>
<id>1</id>
<Discount></Discount>
<Promotion></Promotion>
</ProductS>
<ProductS>
<id>2</id>
<Discount></Discount>
</ProductS>
I want my xmlquery to go through this XML clob and identify if there is an xml tag that contains these two discount and promotion types under ProductS.
My code currently looks like this:
select existsNode(xmltype(rec1.xml), '/ProductS/Discount') into v_node_exists_discount from dual;
select existsNode(xmltype(rec1.xml), '/ProductS/Promotion') into v_node_exists_promotion from dual;
Will ANDing these two statements above work in this type of scenario or do I need to do something else.
Thanks.