Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: WHENEVER SQLERROR doesn't work?
gaverill_at_chsra.wisc.eduNOSPAM (Gerard Averill) writes:
> tbech_at_POP.GO2.PL (Tomasz Bech) wrote in
> <3AB9CCB0.E5F3AB6C_at_POP.GO2.PL>:
> >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)
Yes, failing to create a procedure is no SQL error. You can force an SQLerror by appending an SQL statement that will surely fail if the procedure did not compile, such as
SQL> whenever sqlerror exit failure
SQL> create or replace procedure foo as begin end;
2 /
Warning: Procedure created with compilation errors.
SQL> select 1/decode(STATUS,'VALID',1,0) from user_objects where object_name='FOO'; select 1/decode(STATUS,'VALID',1,0) from user_objects where object_name='FOO'
*
ERROR at line 1:
ORA-01476: divisor is equal to zero
Disconnected from Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
martin_at_beaureve:~$
Received on Tue Apr 03 2001 - 17:40:56 CDT