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 -> Wanted : Help on M u t a t i n g trigger

Wanted : Help on M u t a t i n g trigger

From: David Vanmarcke <david.vanmarcke_at_argenta.be>
Date: Tue, 13 Oct 1998 12:42:45 +0200
Message-ID: <36232eaf.0@news-feed.bru.tfi.be>


Hi,

I'm having troubles with a mutating trigger here ...

Here's an example of what I'm trying to do ...

CREATE TRIGGER my_table_b_d_r
BEFORE DELETE ON my_table
FOR EACH ROW
--

DECLARE
   v_my_parent VARCHAR2(20);
--

BEGIN
--

  SELECT name_child INTO v_my_parent
  FROM my_table
  WHERE child_nr = :OLD.child_parent;
--

  INSERT INTO my_table_his

     (sequence, name_child, name_parent, date)   VALUES
     (:OLD.sequence, :OLD.name_child, v_my_parent, sysdate);
--

END; In other words ...
My record in the history contains the name of the child_rec and also the name of the parent_rec.

I already tried to solve this using a function to get the child_rec_name, declared in the following package with "PRAGMA RESTRICT_REFERENCES" :

create or replace package organigram as   FUNCTION get_description(i_seq IN NUMBER) RETURN VARCHAR2;   PRAGMA RESTRICT_REFERENCES(get_description, WNDS, WNPS, RNPS); end organigram;

But as you might have guessed , this stuff doesn't work with triggers ...

So , anyone knows what to do in a situation like this ???

Thanks !!!

Greetings
D. Vanmarcke
Junior DBA Received on Tue Oct 13 1998 - 05:42:45 CDT

Original text of this message

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