Re: Problemes with trigger

From: Dave Boswell <bd860_at_FreeNet.Carleton.CA>
Date: 1995/04/25
Message-ID: <D7KoBs.10t_at_freenet.carleton.ca>#1/1


In a previous posting, Martin Miron (minto_at_info.polymtl.ca) writes:
> Hy,
>
> I have a problem with ORacle's trigger. I'm trying to use
> the function :
>
> raise_application_error
>
> within a trigger in order to stop the update of a table and
> issue a customised error.
>
> The function does in fact stop the execution of the update , and
> isssue the right customised message, but when the application
> see that the update is stopped, it returns (or ORacle returns) two other
> messages saying that there was an execution error in the trigger.
>
> How can yu avoid the displaying of the two last message? Or, how do
> , or can you stop the execution of an update from within a trigger (
> BEFORE or AFTER one?
>
> Thanks!
>
> MArtin Miron
>
> e-mail: minto_at_info.polymtl.ca
> Martin.Miron_at_dmr.ca
>
>

Use an exception handler in the code that caused the trigger to fire. If you define your own exception and assign the number you returned with the raise_application_error procedure, you can treat it the same way all other exceptions are trapped.

Dave Boswell Received on Tue Apr 25 1995 - 00:00:00 CEST

Original text of this message