I'm in process of creating Oracle procedure to populate one table pulling information from 5 different source tables. To do this i need to declare 5 cursors to select information from source tables and insert into my target table.
I was wondering if there is way to declare one cursor and substitute table names dynamically getting source table names from another table. This would avoid lot of maintenance in future, when my source tables become 5 to 10 in future.
Any help in this regard is much appreciated.
I think that your best shut is to create a procedure that will accept table names as parameters and then dynamically create the procedure the populate/manipulate these tables.