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 Error

Re: Raise Error

From: steph <stephan0h_at_yahoo.de>
Date: Thu, 30 Aug 2007 01:13:27 -0700
Message-ID: <1188461607.948891.60940@g4g2000hsf.googlegroups.com>


On 30 Aug., 09:48, Chintu <agarw..._at_eeism.com> wrote:
> I am trying to raise a simple error in a trigger...But apart from my
> error it also displays two other errors.
> ORA - 6512 at line 10
> and ORA 04088 : error during execution of trigger
>
> My trigger code is
>
> CREATE OR REPLACE TRIGGER CBS_OWNR.BATCHJOBS_TRIG_CHKGROUPNAME
>
> BEFORE INSERT OR UPDATE OF TOGROUP ON
> CBS_OWNR.BILLINGBATCH_BATCHJOBS
> FOR EACH ROW WHEN (NEW.TOgroup IS NOT NULL)
> DECLARE
> NUM_RECS NUMBER;
> FINAL_GROUP VARCHAR2(30);
> E_INVALID_GROUP EXCEPTION;
> BEGIN
> SELECT COUNT(*) INTO NUM_RECS FROM CBS_OWNR.BILLINGBATCH_EMAILGROUPS
> WHERE GROUPNAME=:NEW.TOgroup; --line 10
> IF NUM_RECS = 0 THEN
>
> :NEW.TOgroup:=NULL;
> RAISE_APPLICATION_ERROR(-20901, 'Group Does not Exist');
> END IF;
>
> END;
What do you want to achieve? From what I see you seem to want to set column TOGROUP to null. But as you raise an exception afterwards, this will never happen. Regarding the other error messages: these are subsequent errors to error -20901.

br,
stephan Received on Thu Aug 30 2007 - 03:13:27 CDT

Original text of this message

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