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

Home -> Community -> Usenet -> c.d.o.misc -> Re: triggers update on "column"

Re: triggers update on "column"

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Mon, 6 Mar 2000 17:20:16 +0100
Message-ID: <8a0lsb$en7$1@news3.isdnet.net>


As you can see in the following exemple the trigger is only fired on update of col2:

v734> set serveroutput on size 100000
v734>
v734> create or replace trigger t_bia

  2 before insert or update of col2 on t for each row   3 begin
  4 dbms_output.put_line('trigger fired');   5 end;
  6 /
v734> insert into t values (0,0,0);
trigger fired

1 row created.

v734> update t set col2=1;
trigger fired

1 row updated.

v734> update t set col1=1;

1 row updated.

In Schema Manager, all the columns of the table are always present in the "Update of Columns" list of the "Timing" tab but only the columns actually concerned with the trigger are highlighted.

--
Have a nice day
Michel

<norman.mueller_at_deteline.de> a écrit dans le message : 38c3bfe3.24340539_at_news.deteline.de...
> Hello,
>
> i have a question about triggers. i simply want to create a trigger
> which creates an entry in a table when the value of one - and only
> this one - column in another table was altered.
>
> CREATE OR REPLACE TRIGGER "TRIGGERNAME" BEFORE INSERT OR UPDATE OF
> "Col22" ON "TABLE1" FOR EACH ROW
> ...
> insert into table2 (c1,c2,c3) values
> (:new.col22,:new.col23,:old.col24);
> ....
>
> After saving the trigger i can see in the schema-manager that the
> trigger also fires on changes of col23 and col24 in table1. I can
> avoid this behaviour with adding an if-statement
>
> if :new.col22<>:old.col22 then insert...
>
> I wonder if it is a normal behaviour of oracle that it adds all
> columns that are used in the definition of the trigger in "fire on
> list". I read the documention but i didn't find a note about this.
>
> Norman
>
Received on Mon Mar 06 2000 - 10:20:16 CST

Original text of this message

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