|Thnx a lot Mechanix2Go,|
Can I ask your help for another step that I have to take?
After the creation of the ControlFile.ctl from the .batScript, I renamed it lastFileName.txt, and moved it to another directory (Dir2) [now we have the file lastFileName.txt in Dir2]
Now, the content of the lastFileName.txt, consists of a single line, (the file_Name of a file). As I wanted to make use of this file_Name in the content of another file, I used this .batScript to get the file_Name, ... but I do not know how to assign this value to a variable, and moreover, I cannot make use of this named variable in the rest of the .batScript.
Here is the .batScript,
for /f "tokens=1 delims= " %%a in (Dir2\lastFileName.txt) do (
> Control.ctl echo load data infile %%a append into table TBL_NAME fields terminated by "," optionally enclosed by '"' ( Field1, Field2, Field3, Field4, Field5)
move Control.ctl Dir3
sqlldr user/pass@dbpath control=Dir3\Control.ctl log=Dir3\%%a.log data=Dir1\%%a.dat