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

From: Billy Verreynne <>
Date: 12 Dec 2003 03:58:24 -0800
Message-ID: <>

Sybrand Bakker <> 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?


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).

Received on Fri Dec 12 2003 - 12:58:24 CET

Original text of this message