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: DA Morgan <damorgan_at_psoug.org>
Date: Sat, 03 Sep 2005 09:16:56 -0700
Message-ID: <1125764171.697802@yasure>


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

Original text of this message

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