-
How can I run an SQL command from Unix command prompt?
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
-
-
Re: How can I run an SQL command from Unix command prompt?
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
You can put an exit in you sql script as waitecj has suggested.
Or you can write a shell script as Stecal has suggested.
As an example
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
Of course I might have missed something as I am only a developer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|