Executable that runs a .sql file to prompt for a u

2019-07-22 15:30发布

问题:

I have an executable that connects to an Oracle database and runs a SQL script, stored in a ".sql" file. When the script runs, it prompts for a username input, and then unlocks it. After it completes the unlock and it pops up:

User Altered with no errors

And it goes back to the sqlplus arrow.

I would want the window to close after the script has run. It works perfectly on the remote server, without the connection details in the exe file. For some reason when I add the connection details in my exe to start sqlplus and run this script, it doesn't matter where I put exit at, or how I use it, the window still stays open.

Thanks for the help.

exe. code:

sqlplus system/password//server:1521/db @C:\Scripts\Script2.sql

sql code:

ALTER USER &user_name ACCOUNT UNLOCK;
exit