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: whenever sqlerror exit: exit code and rollback

Re: whenever sqlerror exit: exit code and rollback

From: <sfaroult_at_oriole.com>
Date: Tue, 23 Mar 2004 05:33:33 -0500 (EST)
Message-Id: <20040323102951.7ECD83909C9@turing.freelists.org>


Helmut,

   It may not be supremely elegant but you can keep

    whenever sqlerror exit sql.sqlcode

at the beginning, and put everything else into a

    begin

  block.

HTH, S Faroult

> Hi!
>
> I have a SQL*Plus script that rolls back whenever an error occurs:
>
> .... whenever sqlerror exit SQL.SQLCODE ROLLBACK
>
> Is there a way to get an exit code AND roll back when an error occurs?
>
> I know that "... whenever sqlerror exit 99" exits with an error code but it
> does not roll back that transaction, i.e. if some insert statements were
> already sucessful then they are not rolled back.
>
> Is there any way to exit with an error code and roll back the transaction?
>
> This is 9.2 on HP-UX.
>
> Thanks,
> Helmut
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to: oracle-l-request_at_freelists.org
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------


Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Tue Mar 23 2004 - 04:33:21 CST

Original text of this message

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