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: simple trigger - beginner need help

Re: simple trigger - beginner need help

From: Daniel Cox <DCox_at_mailexcite.com>
Date: Wed, 27 Jan 1999 09:49:11 +1030
Message-ID: <36AE4D6E.1EDA042A@mailexcite.com>


To update a column the trigger needs to be a BEFORE ROW trigger.

create trigger tr_update
before update of colA on my-table
for each row
...

Maxim A Sokolnikov wrote:

> daud11_at_hotmail.com wrote:
>
> > Hi
> >
> > I am trying to create a trigger to automatically update column B after column
> > A has been updated. For example, let say my table my-table has 2 cols colA
> > and colB. I want whenever ColA is updated, colB get updated automatically but
> > I am not sure how to write the trigger to do just that. I have tried using
> > the code below but it still won't work.
> >
> > create trigger tr_update
> > after update of colA on my-table
> > for each row
> > BEGIN
>
> :new.ColB = <some calculaton>;
>
> > END;
> >
>
> Maxim
Received on Tue Jan 26 1999 - 17:19:11 CST

Original text of this message

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