[英]Problems persisting changes to SELF in Oracle PL/SQL member procedure
[英]PL/SQL procedure problems
我試圖編寫一個PL / SQL過程來按部門名稱計算部門中的雇員人數。 每個部門都有一個與之相關的部門編號,每個員工在輸入時即被分配。 到目前為止,這是我的嘗試。 經過大量的練習,我對PL / SQL仍然很不滿意。 我在這里的任何地方都有明顯的邏輯或語法錯誤嗎? 我不是在這里要求任何人為我進行調試,但是oracle sql的錯誤報告沒有提供太多幫助。 謝謝任何回答的人。
create or replace function NumOfEmployee_ByDept
( dept_name in department.Dname%type )
return number
as
empCount number;
begin
select count(*) into empCount
from department, employee
where dno = dnumber
and dname = dept_name;
return(empCount);
end;
語法似乎很好。 桌上的補助金可能有問題。 驗證您要在其中編譯該函數的模式是否具有表的正確權限。 我建議您插入一個異常塊並記錄所傳遞的錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.