Oracle PL/SQL:PLS-00306:调用“EMP_PROJECT”时的参数数量或类型错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19626181/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 05:20:35  来源:igfitidea点击:

Oracle PL/SQL: PLS-00306: wrong number or types of arguments in call to 'EMP_PROJECT'

oracleplsqlsqlplus

提问by An0rak

Create PLSQL procedure which takes a customer id as a parameter and shows
his/her booking. For each booking show room No, hotel, start date and duration

创建 PLSQL 过程,该过程将客户 ID 作为参数并显示
他/她的预订。每个预订的房间号、酒店、开始日期和持续时间

create or replace procedure emp_project(CustID NUMBER)
is 
cursor ecur
is
select r.RoomNo, r.HotelName, StartDate, Duration
from Room r, Booking b
where r.RoomNo=b.RoomNo
and r.RoomNo = b.CustID;
begin
for erec in ecur loop
dbms_output.put_line(erec. RoomNo ||' '||erec. HotelName ||' '|| erec. Duration);
end loop;
end;
/

Can someone please explain What's wrong with my parameter? I get this error when I run it:

有人可以解释一下我的参数有什么问题吗?运行时出现此错误:

SQL> exec emp_project
BEGIN emp_project; END;

     *ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'EMP_PROJECT'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

回答by

Your procedure requires a parameter (nothing apparently wrong with that), but your call to it (exec emp_project...etc.) doesn't seem to provide one.

您的过程需要一个参数(显然没有什么问题),但您对它的调用(exec emp_project...等)似乎没有提供。

Try this:

尝试这个:

exec emp_project(1);     // or any appropriate value instead of 1