SQL*Loader CTL File Creation Automation ?
#1
Moderator
Thread Starter
iTrader: (5)
Join Date: Nov 2001
Location: Not all those who wander are lost
Posts: 17,863
Received 0 Likes
on
0 Posts
SQL*Loader CTL File Creation Automation ?
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 ?
#4
Scooby Regular
Join Date: Jan 2001
Location: still behind twin turbos
Posts: 469
Likes: 0
Received 0 Likes
on
0 Posts
You just need a couple of loops. An outer loop to read in each .ctl file per table, then another loop to loop over each cloned table and run sqlldr against that.
#6
Scooby Regular
Join Date: Jan 2001
Location: still behind twin turbos
Posts: 469
Likes: 0
Received 0 Likes
on
0 Posts
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
#8
Scooby Regular
Join Date: Jan 2001
Location: still behind twin turbos
Posts: 469
Likes: 0
Received 0 Likes
on
0 Posts
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