Re: Q: Triggers and raise_application_error

From: Tony Farrow <tony_at_isotro.com>
Date: 1996/10/09
Message-ID: <325BBFA6.7B24_at_isotro.com>#1/1


I am trying to prevent the last two lines of this error message from being displayed.

> ORA-20001: My Error. << This is EXCELLENT
> ORA-06512: at line 18 << I DO NOT WANT to see this
> ORA-04088: error during execution of trigger 'tablename.trigger'

I have received a few suggestions ( which do not seem to work as I have implemented them )

  1. use FALSE | TRUE values in the raise_application_error(num,message,TRUE) to replace error stack before returning
  2. use when others then clause during the exception handling
  3. pragma exception_init(exception_str, -4088 (or -6512));

It seems that once your trigger hits a raise_application_error within the exception handling it returns with your message/number on the stack. I believe this prevents the exception_init and the when others from catching the -6512 or -4088 messages.

The other two messages do not get placed on the stack until you raise theapplication_error at which point it -seems- to late to handle them.

Any other suggestions would be welcome.

tony

Tony Farrow wrote:
>
> I am trying to remove any additional errors that are being produced
> when I run the exception handling.
>
> ...
>
> if (condition) then
> raise my_error;
> end if;
> ...
> exception
>
> when my_error then
> raise_application(-20001, ' My Error.');
> ....
>
> and this seems to work EXCEPT I get the following additional errors
> when I insert into the table.
>
 

>
> Is there any way to handle the remaining two errors within my
> exception routine?
>
> regards
> tony
> tony_at_isotro.com
  Received on Wed Oct 09 1996 - 00:00:00 CEST

Original text of this message