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

Home -> Community -> Usenet -> c.d.o.server -> Re: Error Handling between SQL*Plus, PL/SQL and OS?

Re: Error Handling between SQL*Plus, PL/SQL and OS?

From: Marc Blum <marc_at_marcblum.de>
Date: Tue, 15 Jan 2002 19:56:36 GMT
Message-ID: <3c4488a6.12810760@news.online.de>


for your SQL+ script consider

WHENEVER SQLERROR
{EXIT [SUCCESS|FAILURE|WARNING|n|variable|:BindVariable] [COMMIT|ROLLBACK]|CONTINUE [COMMIT|ROLLBACK|NONE]} In your OS-script you can then evaluate the returnvalue of SQL+ (in NT it's IF ERRORLEVEL ...)

hope that helps

On 10 Jan 2002 21:16:36 -0800, gdas1_at_yahoo.com (gdas) wrote:

>Hi,
>
>I'm running 8.1.6 on Windows.
>
>I'm trying to dynamically archive or trim the last x months data off
>of a table, export it out to a file with a dynamically constructed
>name and then purge the data from the original table.
>
>I've got a script that works. I use PL/SQL and SQL*PLus to spool out
>a dynamically generated PARFILE. A batch file then runs and does the
>export.
>
>The part I'm not sure about is error handling. Right now, if the
>export fails for whatever reason, the last batch file which launches
>sql plus, connects and purges the data will still run.
>
>I'd appreciate if anyone might be able to share any tips on how I
>might be able to communicate the success or failure of the export
>(either at the OS level or in the database) to the third batch file I
>have which purges the data.
>
>Thanks in advance
>
>Gavin

regards
Marc Blum
mailto:marc_at_marcblum.de
http://www.marcblum.de Received on Tue Jan 15 2002 - 13:56:36 CST

Original text of this message

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