Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. create or replace TRIGGER secure_employees_sal_range
  2. BEFORE INSERT OR UPDATE OF salary,job_id ON employees
  3. DECLARE
  4. p_min_sal Integer;
  5. p_max_sal Integer;
  6. BEGIN
  7. --check_salaray_range(employee_id,job_id,salary);
  8.  
  9. select min_salary, max_salary
  10. into p_min_sal, p_max_sal
  11. from jobs
  12. where job_id = p_job_id;
  13.  
  14. if p_salary < p_min_sal OR p_salary > p_max_sal THEN
  15. RAISE_APPLICATION_ERROR (-20225,
  16. 'Salray should in range' || p_min_sal || ' and ' || p_max_sal);
  17. END IF;
  18.  
  19. END secure_employees_sal_range;
  20.  
  21. Line 13: where job_id = p_job_id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement