PL/SQL with Batch file [message #563797] |
Fri, 17 August 2012 03:20  |
 |
vibo
Messages: 21 Registered: August 2012
|
Junior Member |
|
|
Hi,
I am executing multiple PL/SQL files(.sql) with the help of a single batch file.
The batch file sql.bat has got 3 sub sql sub-tasks to complete once its run. The sql.bat is show below
@Echo off
CD C:\Report
echo Loadin tables from text file Report.txt
sqlplus security/password <c:\Report\loader_security.sql
echo Creating Security table
sqlplus security/password <c:\Report\creating_security_final.sql
echo Inserting text file Security table
sqlplus security/password <c:\Report\insert_security_final.sql
PAUSE
The sql.bat runs perfectly if I double click on the sql.bat file separately.
But if I call the sql.bat from a different batch file 'Final.bat' it throws the below error.
Error
-----------
Executing SQL commands and loading file into SQL tables
Loadin tables from text file Report.txt
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
Creating Security table
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
Inserting text file Security table
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
Press any key to continue . . .
Could you please help me what is incorrect.
The Final.bat file calls other bat files too. It is as show below.
CD C:\Report\Security
echo Merging all Files
CALL merge.bat
CD C:\Report\Security
echo Deleting old files
CALL del.bat
CD C:\Report\Security
echo Executing SQL commands and loading file into SQL tables
CALL sql.bat
Thanks for your help in advance.
VIBO
|
|
|
|
|
|
|
|
|
|
|
|
|
|