Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Copy Row inside a Trigger
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