Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to pass a *.sql file to SQLplus for command line execution ?

pstein-JavaNetMay 16 2007 — edited May 16 2007
Ok, I can login to SQLplus by call sqlplus.exe and entering loginname, password
and wait for the sqlplus command prompt.
Then I can enter e.g.

SQL>@ D:\myproj\test.sql

But how can I pass the sql script directly to sqlplus for execution ?
The trace/textual output should go to a (new) log file D:\myproj\sqlout.txt

I am thinking about something like:

sqlplus.exe system/mypasswd -runscript "D:\myproj\test.sql"
-log "D:\myproj\sqlout.txt"

but this doesn't work

Is there another way or syntax to pass sql scripts and parameters ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 13 2007
Added on May 16 2007
3 comments
3,513 views