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