Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Trigger

Re: Trigger

From: Ales Voboril <alesv_at_post.cz>
Date: Fri, 29 Jun 2001 16:43:45 +0200
Message-ID: <3b3c93fa@news.cvut.cz>

Hello,

try this:

CREATE TRIGGER my_trigger
  BEFORE
  UPDATE OF my_col1, my_col2 ON my_table   FOR EACH ROW
BEGIN
      :new.my_col3 := :new.my_col1 + :new.my_col2 ; END; Ales

kpdp <kpdp_at_nowhere.com> wrote in message news:3B3C919D.648E3F62_at_nowhere.com...
> Hello,
>
> I want to make a trigger which does in a table :
> Colunm 3 = Colunm 2 + Colunm 1 each time I update Column 2 or Column 1
>
> If tried without success:
>
> CREATE TRIGGER my_trigger
> AFTER
> UPDATE OF my_col1, my_col2 ON my_table
> FOR EACH ROW
> BEGIN
> UPDATE my_table SET my_col3 = my_col1 + my_col2 ;
> END;
>
> It doesn't work, do you have an idea ?
>
> Thanks in advance
>
Received on Fri Jun 29 2001 - 09:43:45 CDT

Original text of this message

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