April 15th, 2012, 03:24 PM
Trigger help - IF UPDATING THEN
I've created a trigger named customer_archive_tr on the customer table. The trigger saves the current values of all columns of the customer table to the customer_history table before the record is updated or deleted.
(Here is where I get confused...)
If the customer table is being updated, my trigger should also populate 'customer.last_update_date' using SYSDATE and 'customer.last_updated_by' with USER.
April 15th, 2012, 08:38 PM
I think this is what you need.
WHEN UPDATING THEN BEGIN
:new.last_update_date := SYSDATE;
:new.last_updated_by := USER;