2 Replies Latest reply: Nov 6, 2012 8:33 PM by rp0428 RSS

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

    972915
      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)
      as
      v_minsalary jobs.min_salary%type;
      v_maxsalary jobs.max_salary%type;
      begin
      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;
      end;
      /