Question : Oracle trigger not fire when update with null

The following is my trigger.  The following update doesn't fire the Oracle trigger when hiredate =null .  Works when update to another hiredate.  Please help.  Thanks.
update emp set hiredate =null where empno = 7934;
commit;

CREATE OR REPLACE TRIGGER emp_t
AFTER UPDATE
OF HIREDATE
ON emp  REFERENCING NEW AS NEWROW OLD AS OLDROW
FOR EACH ROW
BEGIN
   IF    :oldrow.hiredate <> :newrow.hiredate
   THEN
      INSERT INTO  test
           VALUES (1, -2, SYSDATE
                  );
   END IF;
END;

Answer : Oracle trigger not fire when update with null

nulls are evil

CREATE OR REPLACE TRIGGER emp_t
AFTER UPDATE
OF HIREDATE
ON emp  REFERENCING NEW AS NEWROW OLD AS OLDROW
FOR EACH ROW
BEGIN
   IF    nvl(:oldrow.hiredate, sysdate+5000) <> nvl(:newrow.hiredate, sysdate+5000)
   THEN
      INSERT INTO  test
           VALUES (1, -2, SYSDATE
                  );
   END IF;
END;
Random Solutions  
 
programming4us programming4us