Hi All,
I want to extract the XML values in the order, how the XML elements are presented. See the sample XML below. the number of elements <GroupOperator> and <properties> are unknown and dynamically generated. I am generating WHERE clause Query using this tags.
I am able to extract values using XMLTABLE() for both, but the order is the problem here. Expected output is like below.Many Thanks.
Note: <GroupOperator> and <properties> elements are come in any order, i.e <properties> element may come after <GroupOperator> and vice versa.
WHERE (country = Austria AND cn_id=000821) -- <Group operator> values
AND generic_name = ABT-510 -- <properties> Values
AND generic_name1= ABT-5101
<SearchCriteria>
<sortOrder></sortOrder>
<LogicalOperator>AND</LogicalOperator>
<recordLimit>1000</recordLimit>
<GroupOperator>
<GroupOperatorValue>AND</GroupOperatorValue>
<properties>
<propertySourceName>country</propertySourceName>
<Operator>=</Operator>
<value>Austria</value>
</properties>
<properties>
<propertySourceName>cn_id</propertySourceName>
<Operator>=</Operator>
<value>000821</value>
</properties>
</GroupOperator>
<properties>
<propertySourceName>generic_name</propertySourceName>
<Operator>=</Operator>
<value>ABT-510</value>
</properties>
<properties>
<propertySourceName>generic_name1</propertySourceName>
<Operator>=</Operator>
<value>ABT-5101</value>
</properties>
</SearchCriteria>'