Automatic Exit after PL/SQL Script

I have a Bourne Shell script that first calls sqlldr then logs into SQL Plus to run a PL/SQL script.

However, when I run this script, I need to type in 'exit' or <ctrl-d> to get back to the cursor.

I would like to be able to run the script and have the cursor return automatically.

Here is my script:

#!/bin/sh
sqlldr <usrname>/<pw> control = control.ctl
sqlplus -s <username>/<pw> @script3.txt
exit
EOF

You need to put an exit command at the end of script3.txt.
If that is not a good option, then you can code your script like this:

#!/bin/sh
sqlldr <usrname>/<pw> control = control.ctl
sqlplus -s username/password << endplus
@script3.txt
exit
endplus
exit

Have a Unix Problem
Unix Forum - Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.