|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
hi
can someone please tell me why the unix script exits once it runs the sql plus. I have to run the sql plus in a unix for loop say for 4 times. But as soon as script runs the script, it simply exits. though there are no errors coming up. ------------------------------ The dir contains 4 ".run" files. But as soon as the sql plus completes, the next file is not taken up by the script and it simply exits. I have checked the procedure. The procedure is running correctly...pls let me know why script exits for name in $(ls *.run) do if [[ -f $name ]] ; then fullname="$(pwd)/$name" echo "file name is $fullname" sqlplus $ID/PW<<-ENDSQL exec proc1 exit ENDSQL fi done |
|
#2
|
|||
|
|||
|
Code:
# i assume this is a sample, all vars are undefined
for name in $(ls *.run)
do
[ -f $name ] || continue # i prefer the inversion
# this condition is not really OK, it's the output of 'ls' so
# the file exists, if you want check for dirs,char-special.... use
# the appropriate option in test
fullname="$(pwd)/$name"
echo "file name is $fullname"
sqlplus $ID/PW<<-ENDSQL
exec proc1 # is this interpreted by the shell or by sql ?
exit # same comment
ENDSQL
done
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Why does korn script exits when it runs sql plus |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|