I want to fire SQL queries only when the user is connected to SQL*Plus. In my case even if the connection is not there, the rest of the commands are running in my SQL script.
if "connect &username/&password@&SID"
...
How to proceed with the queries if only the connect statement is successful?
Best Answer
Use whenever sqlerror in your script before connecting.