I have a SQL loader command which I am calling from a batch script. The data filename is not constant. We have a timestamp appended to it each time the file is generated and populated. So my batch file gets this data file in a variable Fname
.
SET Fname=dir C:\Temp\TEST_*.dat /b
Now, when the Sqlldr
commmand runs from the batch file
sqlldr USERID=xyz/xyz@db CONTROL='C:\Temp\TEST.ctl' LOG='C:\Temp\TEST.log' DATA= %Fname%
I get the error
LRM-00112: multiple values not allowed for parameter 'data'
I cannot enclose the variable Fname
in single quotes. That does not work.
I checked How can I use a variable in batch script at sqlldr?
If I use the method specified in the discussion above and include it in the ctl file as infile %Fname%
I still get the error as the variable Fname
appears as dir C:\Temp\TEST_*.dat /b
and I get error saying file not found.
How do I resolve this?