I need to write a dynamic Select statement to copy data from all the tables in source database to target db tables.
INSERT INTO SRC_TAB_1 (col1, col 2, col3) SELECT col1, col2, col 3 FROM TRG_TAB_1;
INSERT INTO SRC_TAB_2 (col1, col 2, col3) SELECT col1, col2, col 3 FROM TRG_TAB_2;
I have few additional columns in all the target tables which also needs to be populated with default values.
E.g. BATCH_ID = 100, DATE = SYSDATE etc.
Please can anyone advise how to write a SELECT query to copy from 1 table to another dynamically along with populating additional columns as described above.