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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to know in a unix script if oracle procedure executed or failed?

Re: How to know in a unix script if oracle procedure executed or failed?

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 12 Dec 2003 03:58:24 -0800
Message-ID: <1a75df45.0312120358.4d8a355d@posting.google.com>


Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl> wrote

> He wants to know *in the script* whether his procedure succeeded., not
> by looking at log files. Your solution doesn't work, so why contradict
> me with a non-working solution where my solution does work?

Exactly.

In addition you can also declare a bind variable in SQL*Plus and set it in anon PL/SQL blocks in the script (kind of like a process status code). Then terminate the script with the EXIT command using the bind variable as parameter.

Also, the OP should note that the exitcode in Unix is a byte, while the actual exitcode in SQL*Plus (especially when using SQL%SQLCODE to return ORA error numbers) is two bytes. Thus you cannot determine the actual Oracle error code in the Unix script by using the exitcode (in that case you will need to grep the spoolfile).

--
Billy
Received on Fri Dec 12 2003 - 05:58:24 CST

Original text of this message

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