Hi all,
I am running sqlplus from a shell script like following:
sqlplus -L -S /nolog @script.sql
script.sql starts with CONNECT command which connects me to a DB schema. Now there is a login script login.sql which contains an ALTER SESSION statement. As per documentation, this login script is executed:
Prior to the first prompt when /NOLOG is specified on the command line and no connection is made.
That means the login script is executed before connection to DB schema is made and the ALTER SESSION statement generates the "SP2-0640: Not connected" error message
It is not a big deal, but sill I am wondering whether there is a way how to either avoid executing the login script when /NOLOG parameter is specified or how to make the ALTER SESSION statement within the script dependent on presense of database session?
Thanks in advance for your hints.