I want to do something like the following.
I need a loop for all the IDs from dynamic table,
FOR ID_ROW IN (EXECUTE IMMEDIATE 'SELECT ID FROM ' || SRC_TABLE) LOOP
-- some SP calling with ID_ROW.ID
END LOOP;
It is not working, how can I make it run?
Or if following works then also I can work out a solution,
EXECUTE IMMEDIATE 'SELECT ID FROM ' || SRC_TABLE INTO ID_ROW
Where ID_ROW would be of type type CUSTOM_ARRAY is table of VARCHAR2(64);
bulk collectto store all ids in a collection and then iterating over the collection is most probably going to be faster (but it probably won't work with millions of rows)