Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace TRIGGER secure_employees_sal_range
- BEFORE INSERT OR UPDATE OF salary,job_id ON employees
- DECLARE
- p_min_sal Integer;
- p_max_sal Integer;
- BEGIN
- --check_salaray_range(employee_id,job_id,salary);
- select min_salary, max_salary
- into p_min_sal, p_max_sal
- from jobs
- where job_id = p_job_id;
- if p_salary < p_min_sal OR p_salary > p_max_sal THEN
- RAISE_APPLICATION_ERROR (-20225,
- 'Salray should in range' || p_min_sal || ' and ' || p_max_sal);
- END IF;
- END secure_employees_sal_range;
- Line 13: where job_id = p_job_id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement