If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Passing parameters to control file

Hi,
I have to load some ten csv files to 10 different tables in a particular schema say TEST. Is there any way to automate it, instead of writing 10 different control files for each pair of CSV file and table.?I am using sqlldr to load the tables.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

and so on for 30 coulmns then the effort would be too much to create 25 control files to load 25 tables.
I feel it would be better if i have one control file so that i can pass the table name as parameter and call the same control file in a loop.

You can always write a storedproc designed to write a control file on the fly; after all Oracle system views have all the info you need - providing you are loading all columns, in the same order, etc.

It would works like this...
- Main script calls storedproc passing table-name,
- Storedproc writes control file and exits
- Main script calls sqlloader pointing to control file.

It wouldn't be a piece of cake but certainly a nice project to tackle; on the other hand I foresee a myriad of issues with input field lenghts and data types. Probably it would be cheaper in terms of effort to create the control files manually.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.