That's it, I'm just trying to create a trigger that selects an entire record from TABLE EMP and inserts it into TABLE EMP_ARCHIVE when trying to UPDATE (As the name implies, the EMP_ARCHIVE table is a history table for storing changes made to the EMP email table). Both tables have the same fields / columns. The following is the trigger I'm trying to create. I know that there is something wrong, but I could not understand. It throws an error in '(' after the INSERT command. Any help would be appreciated. Forgive me if there is any fundamental error, as I am new to them.
CREATE OR REPLACE TRIGGER Save_EMP_Changes
BEFORE UPDATE ON EMP
FOR EACH ROW
BEGIN
INSERT INTO EMP_ARCHIVE
(
emp_id, emp_name,
emp_age, emp_sex,
emp_active
)
SELECT
:old.emp_id, :old.emp_name,
:old.emp_age, :old.emp_sex,
:old.emp_active
FROM EMP
WHERE emp_id = :old.emp_id
END;
source
share