Pega Robotics create Lookup tables in a loop using ReplaceTableAutoKey
Problem statement - Execute Oracle query 1. Query 1 returns a result set. Oracle query 2 needs to be run for each result of Query 1 (in loop). Output of Query 1 is input for Query 2.
Solution attempted : Executed OracleQuery1 and moved results into a lookup table. Iterate on output using for loop and executed OracleQuery2. Results of OracleQuery2 to be moved into a look table. ReplaceTableAutoKey is being executed on same table in a loop. I have also used Clear() before loading new results into lookup table.
Expected behavior : The lookuptable should be cleared after each iteration and results of current iteration should be loaded using ReplaceTableAutoKey.
Error: I receive an error " A column called Column 1 already belongs to this data table" in the second iteration.
Given that this is using a Database query that you are unlikely to be able to provide an example that you can post here, I would suggest that you open a support case. My guess is that there is a conflict between the tables created by the two queries, although I have not used that method ReplaceTableWithAutoKey (I usually use ReplaceTable but this one seems to just require your table not contain the key column). Examining the columns in each table might lead to a solution, but I would need to be hands on to really assist.