|
-
Hi Joe,
You have to write two file one is the batch file and the other is the sql file.I will write the steps below I have also attached an example here
1) create a batch file on NT orclrun.bat as follows
set ORACLE_SID=orcl
c:\oracle\ora81\bin\sqlplus system/manager @c:\first.sql
2) create a first.sql file as follows
spool c:\result.txt
select * from cat;
select user from dual;
exec procedurename;
spool off;
exit;
Iam creating a batch file in the first step and Iam invoking sqlplus over there and directly in turn executing first.sql from there and all the commands I have stored in first.sql.you can store all ur sql commands over there and I have inserted the spool command over there so that you can verify the result, and offcourse experiment on the batch file like passing parameters to the batch file for username,password that is batch files have parameters from %1 to %8 for example the sqlplus Invoking will look like this
sqlplus %1/%2
so when you execute the batch file you have to pass parameters like this from the command prompt
orclrun.bat system manager
so
system will be %1
manager will be %2
Regards
Santosh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|