Execute procedure from Windows batch file
I tried to call a procedure (my_procedure) from windows batch file. It is doable. The code in batch file is like this:
sqlldr firstname.lastname@example.org control=C:\load\load.ctl
sqlplus -s email@example.com @%MyDir%\my_procedure.sql
Then I saved file as finename.bat or filename.cmd. I click it to run, it will run sqlloader first to load flat file into table. Then it will loginto
SQLPLUS envirnment with pointed database, then it just hang on there. I know SQLPLUS needs adding ' / ' at the end or underneath to make procedure run. I just type '/' at prompt and hit enter key, the procedure will be executed successfully.
The problem is: if I add ';' at the end of my_procedure.sql or add ' / ' underneath into the batch file. It will result in Windows system can not open my_procedure.sql file with SP2-0310 error. If don't have ';' or ' / ', SQLPLUS will not execute my_procedure. So please help me to solve this. How can I add either ';' or ' / ' to the code in batch file and let Windows system can transport into SQLPLUS envirnment for the execution. Thanks a lot.
Click Here to Expand Forum to Full Width