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

Home -> Community -> Usenet -> c.d.o.tools -> Re: WHENEVER SQLERROR doesn't work?

Re: WHENEVER SQLERROR doesn't work?

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Thu, 22 Mar 2001 22:44:13 -0800
Message-ID: <3ABAF0BD.BC98D172@exesolutions.com>

> At the begginig of sql script I have:
> WHENEVER SQLERROR EXIT SQL.SQLCODE
> WHENEVER OSERROR EXIT
>
> later on the package body. In one of the function there is a bug (in my
> case PLS-00103).
> Package si compiled with warnings. WHENEVER SQLERROR doesn't exist in
> this case. (but it works for wrong statements outside the plsql blocks)
>
> How to force the Oracle plsql-compiler to exit when PLS-number error
> occures?
> (I suppose that I should use WHENEVER PLSQLERROR command, but
> such doesn't exits).
> Or how to check at the end of the script that there was something wrong
> and to return error code to shell.

Your syntax is new to me. What I'm used to seeing is:

CREATE OR REPLACE PROCEDURE xyz IS

BEGIN EXCEPTION
   WHEN the_exception THEN

      do_something;

END; And I can guarantee you that when written this way it will always exit the procedure.

Daniel A. Morgan Received on Fri Mar 23 2001 - 00:44:13 CST

Original text of this message

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