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

Re: Trigger on table with many fields

From: <fitzjarrell_at_cox.net>
Date: 3 Sep 2005 12:43:38 -0700
Message-ID: <1125776618.419430.125620@g44g2000cwa.googlegroups.com>

michaelg wrote:
> 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

I cannot understand what it is you want, much less what it is you're doing with this table and trigger business:

| 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.

What, exactly, does this text mean? If you can explain this better possibly someone can assist you. Until then I'm afraid most, if not all, respondents will be lost by your less than clear description.

David Fitzjarrell Received on Sat Sep 03 2005 - 14:43:38 CDT

Original text of this message

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