Quote:
Originally Posted by kwartz
Can somebody please help me resolve this?
I have a batch file that copies various sql file into a temp folder. Then run the sql file from the temp location. However, I have to type exit at the sql prompt when on file is done for it move to the next file. I don't what to hard code exit in the sql script, how do I go about this? Also I want to spool each sql file but don't want to hard code it as well.
Please help as I dire need and my project is behind schedule.
Thanks
-
copy c:\text1.sql c:\temp
-
copy c:\text2.sql c\temp
-
copy c:\text3.sql c:\tem
-
-
sqlplusw user/admin@mtestdb @c:\temp\text1.sql
-
sqlplusw user/admin@mtestdb @c:\temp\text2.sql
-
sqlplusw user/admin@mtestdb @c:\temp\text3.sql
-
-
--------------------------------------------------------------------------------
You will need to use either EXIT or QUIT at the end of each *.sql files. Else the file will not exit after executing the source code in that particular file. Try giving a "/" if you do not want to use exit or quit keyword and using a command EXIT at the END OF FILE is not said as HARD CODING.
Coming to your second requirement, I am not clear with your requirement. You do not want to hardcode the file name to which you want to SPOOL the DATA or you do not want to use SPOOL command in the sql files?