|
Определение триггеров
CREATE TRIGGER
SALARY_CHANGE_HISTORY FOR EMPLOYEE
AFTER UPDATE AS
BEGIN
═════IF (old.SALARY <> new.SALARY) THEN
══════════INSERT INTO SALARY_HISTORY (EMP_NO,
CHANGE_DATE, UPDATER_ID, OLD_SALARY, PERCENT_CHANGE)
VALUES
old.EMP_NO,
"now",
USER,
old.SALARY,
═════(new.SALARY - old.SALARY) * 100 / old.SALARY);
END
|
|