This shows you the differences between two versions of the page.
kurs:tri_1 [2014/09/10 21:22] |
kurs:tri_1 [2014/09/10 21:22] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | == Check_Salary == | ||
+ | ^ Timing | Before | | ||
+ | ^ Object Event | Update | | ||
+ | ^ Fire for | Each Row | | ||
+ | <code> | ||
+ | begin | ||
+ | if :old.salary>:new.salary then | ||
+ | raise_application_error(-20067,'Salary must be higher than the last one!'); | ||
+ | end if; | ||
+ | |||
+ | insert into XL_emp_bonus | ||
+ | (emp_id, last_name, salary, bonus) | ||
+ | values(:OLD.emp_id, :OLD.last_name, :OLD.salary, :OLD.bonus); | ||
+ | end; | ||
+ | </code> |