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

From: Miles Thomas <See_sig_for__at_ddress.com>
Date: 1996/11/21
Message-ID: <5725ih$mgq_at_romeo.logica.co.uk>#1/1


Beware, though, that the WHENEVER statement doesnt work on all platforms. UNIX platforms is ok AFAIK, but windows (even NT) isnt

In article <571svp$o7m_at_news.usf.edu>, rife_at_moffitt.usf.edu (Mike Rife) wrote:
>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
>

Miles Thomas
Logica UK Ltd
thomasm_at_logica.com
The above are personal opinions, and are not necessarily the opinions of my employer. Received on Thu Nov 21 1996 - 00:00:00 CET

Original text of this message