Run Oracle SQL script and exit from sqlplus.exe via command prompt

command-line-interfaceoraclesqlplus

I would like to run an Oracle script through SQL Plus via a Windows command prompt. The script does not contain an "exit" command, but I would still like SQL Plus to exit, returning control to the command prompt on completion of the script. My goal is to do this without modifying the script. Is this possible?

Best Answer

Another way is to use this command in the batch file:

echo exit | sqlplus user/pass@connect @scriptname