Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to check the status of a sql script

Re: How to check the status of a sql script

From: Suzy Vordos <lvordos_at_uswest.com>
Date: Thu, 15 Jun 2000 12:18:47 -0600
Message-Id: <10529.109443@fatcity.com>


Put this line as the first SQL statement:

whenever sqlerror exit sql.sqlcode;

The use $? in the shell to check for a non-zero return code.

Suzy

David Lee wrote:
>
> Hi all,
> I am writing a shell script to do hot backups. I have a sql script embedded
> in it saying ' alter tablespace ... begin backup' stuff.
> Now I want to put something in my shell script so that if the sql script
> fails, the hot backups are cancelled and tablespaces are taken out of
> hot backup mode. But the thing is, How do I see the exit status of the sql
> script?
>
> TIA
>
> David
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
> --
> Author: David Lee
> INET: dba_lee_at_hotmail.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
Received on Thu Jun 15 2000 - 13:18:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US