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

Home -> Community -> Usenet -> c.d.o.server -> Re: raise_application_error in before delete trigger.

Re: raise_application_error in before delete trigger.

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 16 May 2001 20:13:34 +0200
Message-ID: <tg5gmd3tv9t095@beta-news.demon.nl>

"Tim Belding" <Tim_Belding_at_Dell.com> wrote in message news:9du84g$219e$1_at_galaxy.us.dell.com...
> Hi,
>
> Can you use this function in a trigger to stop an unwanted deletion?
>
> It throws the error we define, but also some Oracle errors as well:
> ORA-20001: Cannot delete record because of status.
> ORA-06512: at "RMS_DATA.JIA_STATUS_CHECK", line 30
> ORA-04088: error during execution of trigger 'RMS_DATA.JIA_STATUS_CHECK'
>
> If not how would you stop a deletion from occurring in a trigger?
>
>

This is just the way it usually works.
The two Ora - error messages are free of charge by the house. So your code is working as expected.

Second question : can I get rid of the two ora-error messages. Yes but in that case your trigger has to trap the exception and you need to use the dbms_utility.format_error_stack procedure to have it properly formatted.
IMO, not worth the trouble.

Hth,

Sybrand Bakker, Oracle DBA Received on Wed May 16 2001 - 13:13:34 CDT

Original text of this message

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