Load data from multiple data files into multiple tables using single ctl file

astrob0t picture astrob0t · Dec 13, 2012 · Viewed 8.1k times · Source

I have 3 data files and 3 staging tables. Is there any way to enter the data from the data files to their respective staging tables using only a single control file using parameters.

To detail out the scenario, there are 3 data files namely A.dat, B.dat, C.dat whose data are to be entered into A_Stg, B_Stg,C_Stg staging tables respectively. This can no doubt be done using separate ctl files. But the requirement is to do it using a single loader file.

Any pointers in this direction would be great.

Answer

astrob0t picture astrob0t · Dec 14, 2012

using 1 ctl file there exists four combinations.

  1. insert data from multiple data files to a single table
  2. insert data from a single data file to multiple tables
  3. insert data from single data file to single table
  4. insert data from multiple files to multiple tables.

the first three are possible for any situation. but the fourth case is possible only when the structure of all tables is the same. otherwise we have to go for multiple ctl files.

more info can be found here