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: Chintu <agarwalp_at_eeism.com>
Date: Thu, 30 Aug 2007 01:23:37 -0700
Message-ID: <1188462217.930097.239780@22g2000hsm.googlegroups.com>


On Aug 30, 1:13 pm, steph <stepha..._at_yahoo.de> wrote:
> 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- Hide quoted text -
>
> - Show quoted text -

Yes if entered value in the ToGroup is not in the Emailgroups Table then set the value to null and and also display a message or error about why it has been changed to null.

Thanks
Chintu Received on Thu Aug 30 2007 - 03:23:37 CDT

Original text of this message

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