How can I specify the load file name in sql loader control file during runtime (as command line parameter) instead of hard coding the name in variable?
Printable View
How can I specify the load file name in sql loader control file during runtime (as command line parameter) instead of hard coding the name in variable?
If you want it in the control file infile='1.dat'
or on the command line data=1.dat
You can dynamically create the control file at run time from the procedure that runs sql loader.Quote:
Originally posted by sbasak1
How can I specify the load file name in sql loader control file during runtime (as command line parameter) instead of hard coding the name in variable?
Tried running
sqlldr outln/outln@odsdev01 control='/data/src/xs54/database/Tesco_TicketVoucher.ctl' INFILE=/data/src/xi11/test/data/Tesco_TicketVoucher.bcp
but says
SQL*Loader-100: Syntax error on command-line
Tried with both quote & without quote
no, infile is when you want to put it in the control file
you want data=...
As you were told in the first reply, you must use DATA=..., if you want to specify the input datafile from the command line! So,
sqlldr outln/outln@odsdev01 control='/data/src/xs54/database/Tesco_TicketVoucher.ctl' DATA=/data/src/xi11/test/data/Tesco_TicketVoucher.bcp
Thanks, it worked
/appl/oracle/product/9.2.0/bin/sqlldr outln/outln@odsdev01 control='/data/src/xs54/database/Tesco_TicketVoucher.ctl' DATA=/data/src/xi11/test/data/Tesco_TicketVoucher.bcp BAD=/data/src/xs54/database/Tesco_TicketVoucher.bad DISCARD=/data/src/xs54/database/Tesco_TicketVoucher.dsc
:)