Trigger Question
Date: 1997/12/30
Message-ID: <34A9A363.36C8497C_at_navpoint.com>#1/1
[Quoted] I want to create a trigger that will scan for several columns and if they are updated, write the old and new values to an audit table. I am trying a trigger AFTER UPDATE FOR EACH ROW that goes something like this:
if :old.name <> :new.name then
// procedure that adds user ID, sysdate and checks for INSERT vs.
UPDATE
record_change( :old.empid, "NAME", :old.name, :new.name);
end if;
// repeated several times for various other fields
This appears to work sporadically, but not consistently, for example, if the new value is a null string nothing happens. If several columns are updated at once, not all seem to get audited.
Is there something I'm missing here? (Obviously!) Do I need a separate trigger for each column I want to audit? Received on Tue Dec 30 1997 - 00:00:00 CET