alannel 2017-04-09 10:43 采纳率: 0%
浏览 763
已结题

oracle 10g执行procedure是会卡死

代码如下:
create or replace procedure p_class
(sum out number,p_cno in number,ps_date in date,pe_date in date) is
o_num number(2):=0;
a_num number(2):=0;
l_num number(2):=0;
t_cno number(10);
p_date date;
cursor c_attend is select absent,late ,off,cno,c_date from class_attend;
begin
open c_attend;
loop
fetch c_attend into a_num,l_num,o_num,t_cno,p_date;
if t_cno=p_cno and to_char(p_date,'yyyymmdd') between to_char(ps_date,'yyyymmdd') and to_char(pe_date,'yyyymmdd') then sum:=o_num+a_num*5+l_num*2;
exit when c_attend %notfound;
end if;
end loop;
close c_attend;
end;
.

declare
psum number;
p_cno class_attend.cno%type;
s_date date;
e_date date;
begin
p_cno:=1501;
s_date:=to_date('20170314','yyyymmdd');
e_date:=to_date('20170331','yyyymmdd');
p_class(psum,p_cno,s_date,e_date);
update class_attend set sum_evaluation=psum where cno=p_cno;
end;
.
/
过程编译通过了,执行时会卡死,网上找了一一些办法都没有用。本人是菜鸡刚开始接触,希望有大牛可以解惑

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-04-09 15:35
    关注
    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大