Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Colleagues, good day!
I have one example to test loading table using WHERE condition, which values are stored in Table field.
My source table:
ID | Field1 | Field2 | Condition |
1 | A | B | Field1='A' |
2 | C | D | Field1='C' |
3 | A | B | Field1='C' or Field2='B' |
4 | A | C | Field2='K' |
5 | A | K | Field2='D' |
My task is to load new table using for loop statement and each iteration (quantity of iterations is equal to unique numbers of Conditions) of this loop must append new values using WHERE condition corresponds to field Condition.
For example.
1. First iteration: We read the table and create only those values, which corresponds to Condition #1: Field1='A'
ID | Field1 | Field2 | Condition |
1 | A | B | Field1='A' |
3 | A | B | Field1='C' or Field2='B' |
4 | A | C | Field2='K' |
5 | A | K | Field2='D' |
2. Second iteration: We read the table and append only those values to result of the first iteration, which corresponds to Condition #2: Field1='C'
ID | Field1 | Field2 | Condition |
2 | C | D | Field1='C' |
After two first iterations, we must fetch the following table:
ID | Field1 | Field2 | Condition |
1 | A | B | Field1='A' |
3 | A | B | Field1='C' or Field2='B' |
4 | A | C | Field2='K' |
5 | A | K | Field2='D' |
2 | C | D | Field1='C' |
There're test model and source file in attachment.
Thanks for the advice.
Don't think I understand what you are trying to do... can you elaborate on your conditions part here