1

I want to process all the .CSV in files (data files) in specific folder. My problem is how can i pass this file name to sql loader as every time it would be different file name.

I want to have all this stuff in single batch file so that i can schedule it whenever i wish.

Can anyone help me out pls?

Thanks in advance....

Mehul

1 Answer 1

4

Assuming for each .csv file there is a corresponding .ctl (control file) the following should work:

for %%i in (*.csv) do ( 
   sqlldr data=%%i control=%%~ni.ctl log=%%~ni.log
)

This assumes the files are in the current directory. You might want to add the approriate cd commands before iterating over the input files.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.