SQL*Loader CTL File Creation Automation ?
Thread Starter
Joined: Nov 2001
Posts: 17,864
Likes: 0
From: Not all those who wander are lost
I have a large number of data dumps that need to be loaded into tables easily using SQL*Loader.
There are 9 different table structures which are cloned about 50 times, so 450 tables to load into.
I have a CTL file for each of the 9 different structures, each tailored for their own columns. I will have 450 data files that need loading into these tables.
If I have a list of the tables and a list of the data files. How can I quickly create the required CTL files ? I need 450 CTL files with the input file and table name within it (I could put the input file in the command line, so at a minimum I need the table name in there). Or can I put the target table in the command line too ?
I intend to write a shell script to run the 450 sqlldr commands when they're all done.
Any ideas on how best to do this ?
There are 9 different table structures which are cloned about 50 times, so 450 tables to load into.
I have a CTL file for each of the 9 different structures, each tailored for their own columns. I will have 450 data files that need loading into these tables.
If I have a list of the tables and a list of the data files. How can I quickly create the required CTL files ? I need 450 CTL files with the input file and table name within it (I could put the input file in the command line, so at a minimum I need the table name in there). Or can I put the target table in the command line too ?
I intend to write a shell script to run the 450 sqlldr commands when they're all done.
Any ideas on how best to do this ?
Assuming you can pass the table name:
Let's try this edit.
Code:
for each .ctl file you have ## this is the outer loop
for each cloned table ## this is the inner one
call the current .ctl file against that table
end loop
end loop
Trending Topics
Maybe I misunderstood. If the .ctl files are the same for each cloned table (the 50 clones of each of the 9 tables) then you only need one .ctl file for each table type, you just need to specify each cloned table to the .ctl, no?
Thread
Thread Starter
Forum
Replies
Last Post





I'll try it out, thanks.
