The trouble is, if I run in following way
$ORACLE_HOME/bin/sqlplus user/pwd@database @'/data/src/myfile.sql'
after running the script, the prompt remain within SQL Plus environment. I want it to get back in Unix command prompt.
Thanx
Printable View
The trouble is, if I run in following way
$ORACLE_HOME/bin/sqlplus user/pwd@database @'/data/src/myfile.sql'
after running the script, the prompt remain within SQL Plus environment. I want it to get back in Unix command prompt.
Thanx
Add an EXIT to the end of your script call?
Code:$ORACLE_HOME/bin/sqlplus user/pwd@database @'/data/src/myfile.sql' exit
Or run a shell script.
You can put an exit in you sql script as waitecj has suggested.Quote:
Originally posted by sbasak1
The trouble is, if I run in following way
$ORACLE_HOME/bin/sqlplus user/pwd@database @'/data/src/myfile.sql'
after running the script, the prompt remain within SQL Plus environment. I want it to get back in Unix command prompt.
Thanx
Or you can write a shell script as Stecal has suggested.
As an example
Of course I might have missed something as I am only a developer. ;)Code:#!/usr/bin/sh
export ORACLE_HOME=/usr/export/oracle/9.2/bin
export ORACLE_SID=mysid
export LD_LIBRARY_DIR=$ORACLE_HOME/lib
sqlplus /nolog << EOF
connect / as sysdba
--insert sql here
EOF
exit