ORACLE存储过程调用问题。。。? 400 报错 create or replace procedure SP_AntibioticsUse_Counter(p_beginDate varchar2,
p_endDate varchar2,
p_result out sys_refcursor ) is
begin
OPEN p_result for
select deptname, useCount, visitCount
from (select t5.deptid, t5.deptname deptname, count(t1.patientid) useCount
from PA_DATA_PATIENT t1,
PC_CL_DATA_RECIPE t2,
PC_CL_DATA_RECIPEENTRY t3,
OM_DEPARTMENT t5,
PH_DRUGITEM t4
where t1.patientid = t2.patientid
and t2.recipeid = t3.recipeid
and t4.drugid = t3.itemid
and t4.ISANTIBACTERIAL = 1
and t2.inputtime >= to_date(p_beginDate, 'yyyy-mm-dd')
and t2.inputtime <= to_date(p_endDate, 'yyyy-mm-dd')
and t5.deptid = t2.deptid
group by t5.deptcode, t5.deptname, t5.deptid) useCount,
(select t7.deptid, count(t1.patientid) visitCount
from PA_DATA_PATIENT t1,
PC_CL_DATA_RECIPE t2,
PC_CL_DATA_RECIPEENTRY t3,
OM_DEPARTMENT t7,
PH_DRUGITEM t4
where t1.patientid = t2.patientid
and t2.recipeid = t3.recipeid
and t4.drugid = t3.itemid
and t2.inputtime >= to_date(p_beginDate, 'yyyy-mm-dd')
and t2.inputtime <= to_date(p_endDate, 'yyyy-mm-dd')
and t7.deptid = t2.deptid
group by t7.deptcode, t7.deptname, t7.deptid) visitCount
WHERE useCount.deptid = visitCount.deptid;
end SP_AntibioticsUse_Counter;
调用 : call SP_AntibioticsUse_Counter('2013-05-01','2013-05-02'); 出错,提示参数类型或数目有误。
存储过程中第三个参数是出参,应该调用的时候不用填吧,不知道错在哪里,请高手指点。
oracle.jdbc.OracleTypes.CURSOR######group by t5.deptcode, t5.deptname, t5.deptid三项,但是你select只有两项######你好,我也刚开始学习写oracle的存储过程,写好的存储过程怎么执行呢?######@御风林海 不是exec吗?######call 存储过程名字(参数1,参数2....) @神户牛肉
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。