Andy5
Andy5

Reputation: 2405

Bat File and SQLPLUS

I have small .bat file that logs on to Oracle 11g database using SQLPLUS and executes a .sql file. The problem I am getting is exiting SQLPLUS via the .bat file. Searching the internet, I was lead to believe leaving a line and then write EXIT, but this does not work.

So, my question is, how do I exit SQLPLUS via a .bat file?

Upvotes: 2

Views: 4499

Answers (2)

Pradhyoth
Pradhyoth

Reputation: 148

Add a '/' (add it without quotes) at the end of the .sql file without any space in front of it. This will cause the control to exit from the .sql file and back to your .bat file.

Upvotes: 0

Grant Zhu
Grant Zhu

Reputation: 3018

Add exit and | before sqlplus command.

exit|sqlplus

e.g.

a.bat:
exit|sqlplus system/system@orcl @1.sql
exit|sqlplus system/system@orcl @2.sql

Upvotes: 4

Related Questions