Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to check the status of a sql script
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
![]() |
![]() |