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 -> Copy Row inside a Trigger

Copy Row inside a Trigger

From: Joachim Zobel <jz-2004_at_heute-morgen.de>
Date: Thu, 03 Feb 2005 18:29:13 +0100
Message-ID: <pan.2005.02.03.07.48.32.910947@heute-morgen.de>

Hi.

To do historisation I copy each row to an identical table in a before trigger. This is working well for one table at the moment. However I have to do a very ugly

INSERT INTO the_table_past(field1, field2,..) VALUES (:old.field1, :old.field2, ...);

which explicitely names all fields (about 50). Doing an

INSERT INTO the_table_past SELECT * FROM the_table;

is not possible since it would read a mutating table.

Now I would like to do the same for more tables and I do want to avoid copying of the source code if possible. Is there a way to write a generic copy row function for usage inside a trigger, where the table is used as a parameter?

Thanks,
Joachim

-- 
Warnung: \" kann Augenkrebs verursachen. 
Received on Thu Feb 03 2005 - 11:29:13 CST

Original text of this message

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