This discussion is archived
2 Replies Latest reply: Nov 6, 2012 6:33 PM by rp0428 RSS

ORA-01422: exact fetch returns more than requested number of rows

972915 Newbie
Currently Being Moderated
Hey guys can you really help me i tried to create trigger for check salary based min and max salary .. but i have a little problem in here ...
so i really need your help .. i'm sorry for my bad english

create or replace procedure check_salary(job_id in employees.job_id%type, salary in employees.job_id%type)
v_minsalary jobs.min_salary%type;
v_maxsalary jobs.max_salary%type;
select min_salary, max_salary
into v_minsalary, v_maxsalary
from jobs
where job_id=job_id;
if salary <= v_minsalary and
salary >= v_maxsalary then
raise_application_error(-20505,'Invalid Salary'||salary||'Salaries for job'||job_id||'must between'||v_minsalary||'and'||v_maxsalary);
end if;


  • Correct Answers - 10 points
  • Helpful Answers - 5 points