Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: triggers update on "column"
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
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
![]() |
![]() |