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

From: Stephan Witt <stephan.witt_at_beusen.de>
Date: 1996/11/24
Message-ID: <32984B3C.14BE9CCB_at_beusen.de>#1/1


Alfred Oegger wrote:
>
> 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

Want to make a footnote.
The return codes usually are 8bit, the Oracle-Error-Codes >= 15bit. There is
the possibility to hit an error code with zero exit status. If you are interested in binary info error vs. noerror, the better solution is
WHENEVER SQLERROR EXIT FAILURE
(Don't just curious, I got this problem with sqlplus in conjunction with make.
 Very diffucilt to track down this one!)

Hope it helps, Stephan Witt



<stephan.witt_at_beusen.de> | "beusen" Software+Systeme GmbH
fon: +49 30 549932-62     | Landsberger Allee 392
fax: +49 30 549932-21     | 12861 Berlin
---------------------------------------------------------------
Received on Sun Nov 24 1996 - 00:00:00 CET

Original text of this message