Skip to content
Advertisement

Without loop how to insert values into table from XML node

I have the following requirement.

I have an XML variable of values.

I now should insert the values for this XML variable to a table (Table A), but need to check if the items (one by one) in the XML variable are already present in another table (Table B) and the count of that individual item present in table B is only once.

If more than once/ or not present in Table B, do not insert into the main table – Table A.

How to achieve this without using loops.

Now in Table B — have to check if the items ‘One’ and ‘Two’ are present, if present are they present only once.

Tired using while loops which works fine, but want to achieve without loop.

Advertisement

Answer

Since you already have a selection of your rows to evaluate (@values in my solution), I started from there.

Sample data

Solution

Result

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement