我不明白我的存储过程中出了什么问题

问题描述 投票:0回答:1
Create or replace PROCEDURE SSp_EmpHoursInfo
(p_EHrsInfo OUT SYS_REFCURSOR)
AS
BEGIN
OPEN p_EHrsInfo FOR
                     Select 
                     a.personid, a.first_name, a.last_name,c.hoursworked,d.carecentername, c.break

                     from person a
                     join employee b on a.personid = b.empersonid 
                     join employee_assigned_care_center c on b.empersonid = c.empersonid
                     join care_center d on c.empersonid = d.carecenterid
                     where hoursworked> 10;

END SSp_EmpHoursInfo;

每次我尝试调用存储过程时,都会给我这个错误消息:

Error starting at line : 225 in command -
BEGIN SSp_EmpHoursInfo (hoursworked> 10); END;
Error report -
ORA-06550: line 1, column 3:
PLS-00201: identifier 'HOURSWORKED' must be declared
ORA-06550: line 1, column 52:
PL/SQL: Statement ignored
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:
oracle stored-procedures
1个回答
0
投票
问题非常明显。

BEGIN SSp_EmpHoursInfo (hoursworked> 10); END;不是正确的调用方式。

过程参数必须是sys_refcursor。

© www.soinside.com 2019 - 2024. All rights reserved.