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

From: Mike Rife <rife_at_moffitt.usf.edu>
Date: 1996/11/21
Message-ID: <571svp$o7m_at_news.usf.edu>#1/1


You can utilize the "WHENEVER SQLERROR EXIT n" SQL*Plus command to return a return code value of "n" to the shell script. Then in your shell script you can look at $? for the return status of the SQLPLUS command. Make sure the you look at $? right after the SQLPLUS command $? has the return code of the last executed command.

In article <01bbd6e3$68420ce0$aa42ea9e_at_lbis4.Logica-UK>, gracias_at_logica.com says...
>
>Hi there,
>
>I have got a Unix shell script running several PL/SQL scripts (via
 sqlplus)
>sequentially. I would like to exit this shell if any of the PL/SQL
 scripts
>fails and return an error code to the scheduller which runs this shell.
>Is there an easy way to get the execution status from sqlplus ?
>
>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
>--
>Sergio Gracia GraciaS_at_Logica.com
>Logica uk ltd (44)0171 637 9111
>51-53 Great Marlborough street
>London W1V 1HL
>UK
Received on Thu Nov 21 1996 - 00:00:00 CET

Original text of this message