i have a table in oracle and i want to study the updates on lines
id number,
title varchar2(10),
modify_date date
i have created a trigger to feed the modify_date :
create or replace
TRIGGER schema.name_of_trigger
BEFORE UPDATE ON schema.name_of_table
FOR EACH ROW
BEGIN
:new.modify_date := sysdate;
END;
but when i make a big update from another table i would like the modify_date to be updated ONLY for lines with a new value, not all lines.
update mytable a set title = (select title from mytable2 b where b.id = a.id)
Is it possible ? i thought Oracle would not update a field with the same value
Thanks
You thought wrongly, Oracle does what you order it to do.
You can either try
or change the trigger to specifically check for a different title name.