Re: HELP : getting execution status from sqlplus to Unix scripts

From: Alfred Oegger <Alfred.Oegger_at_bazl.admin.ch>
Date: 1996/11/20
Message-ID: <32930F1D.5029_at_bazl.admin.ch>#1/1


sergio wrote:
>
> Here is the type of shell script I use :
>
> #!/bin/ksh
> ...
> sqlplus user1/user1 _at_load_person.sql > $LOGFILE
> ...
> sqlplus user1/user1 _at_load_address.sql > $LOGFILE
> ...
>
> Any suggestion is welcome. Thanks.
>
> Sergio
>
In my Scripts i make this with whenever sqlerror Look like this is a Test
sqlplus / <<!

         whenever sqlerror exit sql.sqlcode
         insert into nls values('Error',33);
exit;
!
#

   if (( $? != 0 ))
   then

      echo "***** Fehler            *****"
      exit 1

   fi
#

I hope this give a idea
Fred
Alfred.Oegger_at_bazl.admin.ch Received on Wed Nov 20 1996 - 00:00:00 CET

Original text of this message