Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger on table with many fields
michaelg wrote:
> Hi there,
>
> I have a problem using a trigger on a table with many field (>150).
Lets stop right here. This is a strong indication of a very bad design. Looking at the code example below, field1 .. field150, there is no question that this is a very bad design.
Before even thinking about the trigger ... you need to find someone to help you fix this table.
> 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:
>
At best: This will be a report writer's nightmare.
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Sat Sep 03 2005 - 11:16:56 CDT