Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: WHENEVER SQLERROR doesn't work?
> 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
![]() |
![]() |