Oracle trigger if updating column

We cannot create an AFTER INSERT TRIGGER on an Oracle PLSQL VIEW.

We cannot update : NEW values with AFTER INSERT TRIGGER.

Two hours later you’re sitting there scratching your head.

A simple test could protect against “false updates”, and perhaps bypass the update and send an alert log message that a DML statement is doing superfluous updates.The first only cares if the value is actually being altered.Since Oracle 9i, you may use pseudocolumns like SYSDATE or CURRENT_TIMESTAMP in DEFAULT clauses.For this purpose we can create a PLSQL AFTER UPDATE TRIGGER as: CREATE OR REPLACE TRIGGER new_employee_trigger AFTER UPDATE ON new_employee FOR EACH ROW DECLARE v_creator_name VARCHAR2(1000); v_creation_date DATE; BEGIN --Getting the name of the current logged in User SELECT USER INTO v_creator_name FROM dual; --setting system date in v_creation_date v_creation_date := sysdate; --Inserting data the new_employee_duplicate table INSERT INTO new_employee_duplicate VALUES (:new.employee_id ,:new.employee_name ,v_creation_date ,v_creator_name); END; Here we have created a PLSQL AFTER UPDATE TRIGGER named ‘new_employee_trigger’ which will insert a record in the ‘new_employee_duplicate’ table as soon as update operation is performed on ‘new_employee’ table.Here using the Oracle PLSQL AFTER UPDATE TRIGGER we can see that in the ‘new_employee_duplicate’ table a record got inserted as soon as we updated a record in ‘new_employee’ table.

Oracle trigger if updating column