December 10th, 2003, 11:40 AM
hi guys how can i write a trigger on myemp tabl to;
1. Sales persons should always receive commission. Employees who are not sales persons should never receive a commission;
2. Salaries may only be increased, never decreased.
December 11th, 2003, 09:33 AM
I just type a trigger for:
(2)Salaries may only be increased, never decreased.
CRAETE TRIGGER salary_check
INSERT OR UPDATE OF salary ON myemp
FOR EACH ROW
SELECT salary INTO currsal
WHERE employee# = :new.employee#;
IF (:new.sal < currsal) THEN
raise_application_error (-20888, 'New salary for this empoyee ' || :new.employee# || ' must be greater than its current salary');