I have a table employees and a table where I need to store the ones who are not employees anymore. I need to insert the employees deleted to that table with a trigger.
I tried this code but doesn't work
CREATE TRIGGER EX4
ON EMPLOYEES
AFTER delete
AS
BEGIN
insert into BAIXES
values(@ID, 'deleted')
END
This is what the exercise says (it's translated so it may have translation problems.
Create a trigger that sign up to the previous table, the worker that is removed from the table works. The data of the worker must be saved, and the variables USER and SYSDATE. The trigger must be triggered AFTER DELETE.
@IDsupposed to be? - Gordon Linoff