I am using ORACLE 12c.
On a table I have 2 triggers, both "before update". One of the triggers fires while updating a column and within this trigger another column gets a new value. The second trigger should fire while updating this second column. But he did not.
create table TRIGGER_TEST
(
col1 varchar2(64),
col2 varchar2(64),
col3 varchar2(64)
);
create or replace trigger TR_TRIGGER_TEST_1
before update of COL1 on TRIGGER_TEST
for each row
begin
dbms_output.put_line('here we are in TR_TRIGGER_TEST_1');
:new.col2 := 'only testing';
end;
/
create or replace trigger TR_TRIGGER_TEST_2
before update of COL2 on TRIGGER_TEST
for each row
begin
dbms_output.put_line('here we are in TR_TRIGGER_TEST_2');
:new.col3 := 'trigger_test_2 has fired';
end;
/
insert into TRIGGER_TEST values ('1_col1','1_col2','1_col3');
select * from TRIGGER_TEST;
COL1 COL2 COL3
----------------------------------------------------------------
1_col1 1_col2 1_col3
After I have inserted the row I perform an UPDATE. And I expect COL1= "now we will see", COL2="only testing" and COL3 = "trigger_test_2 has fired".
update TRIGGER_TEST set COL1 = 'now we will see';
But what I get is this:
select * from TRIGGER_TEST;
COL1 COL2 COL3
----------------------------------------------------------------
now we will see only testing 1_col3
Can anybody explain this to me? I am really sure, that with former ORACLE versions this szenario has worked. But now it does not.