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: Table trigger and NEW value

Re: Table trigger and NEW value

From: Andreas Ballenthin <ballenth_at_gmx.de>
Date: Wed, 19 Dec 2001 18:57:53 +0100
Message-ID: <3C20D521.17F39C19@gmx.de>


Hi all,

> > CREATE or REPLACE TRIGGER t_nstudents
> > BEFORE
> > INSERT OR UPDATE OF ID_Cycle ON Students

...

> > SELECT COUNT(*) INTO actual_s
> > FROM students
> > WHERE ID_Cycle = :new.ID_Cycle ;

> You need the FOR EACH ROW clause to access the :new and
> :old variables.

...but row trigger fails; mutating table.

He should create a package including a PL&SQL-Table of ID_Cylces. A before (or after, thats the same) row trigger fills this table - and the after STATEMENT trigger validates each of ID_Cycles in this PL/SQL-Table.

cu
Andreas Received on Wed Dec 19 2001 - 11:57:53 CST

Original text of this message

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