Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Trigger on table with many fields
Hi there,
I have a problem using a trigger on a table with many field (>150). This is the trigger :
create or replace trigger trg_tst
after insert or update on tst_table1
For each row
declare lfd number(10);
begin
select test_seq.nextval into lfd from dual; insert into tst_table2 values (:new.field1,
:new.field2,
:new.field3,
. .
:new.field150
lfd);
The field2 of table1 and table2 are the same, but table2 has added one field (seq_nr).
The trigger works fine, but because of internal reasons in our system we save the trigger, when table1 is deleted and recreate it when table1 gets created. But the table where it is saved, is quite short and it is not possible to change it, so the trigger body is cut offed. Do you have any ideas, how to optimize this trigger, to get it shorter ? I thought to call a function, which fills the field, but I am quite newbie in Oracle.
Hope s.o. can help me
Thanks in advance
Mike Received on Sat Sep 03 2005 - 02:40:03 CDT