0
我已经创建了一个过程。它给出了一个错误(ORA-01422:确切的提取返回比请求的行数多)。至于具体的department_id,有多个员工。但如何解决这个问题?PL/SQL:执行过程
Create Procedure PP1
(ID in number, Percent in number, Sal out number, increase_sal out number) IS
Begin
Select salary, salary *(1+percent/100) into sal, increase_sal
From employees
where department_id= id;
DBMS_OUTPUT.PUT_LINE (sal || ' ' || increase_sal);
END;
/
Variable a number
Variable b number
Exec PP1 (100, 10, :a, :b)
Print a b
感谢, Kuntal罗伊
你期望你的输出是什么?一个变量一次只能保存一个值,所以你不能执行返回多行的'select ... into ...'。 – GriffeyDog
是的。如果我将使用employee_id = id而不是department_id = id,则该过程将返回值。 但是如果我想增加特定部门的工资怎么做? – user2788235
正确,那么当您使用'department_id'代替时,您希望'a'和'b'的值从您的过程中出来?你想达到什么目的? – GriffeyDog