UNIX Programming, Certification, System Administration, Performance Tuning Reference Books
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

Quick Links:
Do you have a UNIX Question?

Unix Home: Unix System Administration Hints and Tips