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 -> Trigger on table with many fields

Trigger on table with many fields

From: michaelg <mikespanien_at_hotmail.com>
Date: 3 Sep 2005 00:40:03 -0700
Message-ID: <1125733203.521333.189690@g47g2000cwa.googlegroups.com>


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);

  end:

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

Original text of this message

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