17,377
社区成员
发帖
与我相关
我的任务
分享
CREATE OR REPLACE PROCEDURE p_ip_bill_tf
( pm_reg_no IN VARCHAR2)
IS
v_cfh ipbill.pre_no%TYPE;
v_cfrq ipbill.bill_date%TYPE;
v_chrg_no ipbill.chrg_no%TYPE;
v_reg_no ipbill.reg_no%TYPE;
CURSOR cr(zyls VARCHAR2) IS select case when old_pre_no is not null then old_pre_no else pre_no end as cfh,
case when old_bill_date is not null then old_bill_date else bill_date end as cfrq,
chrg_no,reg_no
from ip_bill f where reg_no=zyls and chrg_no=0 and nvl(yb_send_flag,'0')='0'
group by case when old_pre_no is not null then old_pre_no else pre_no end ,
case when old_bill_date is not null then old_bill_date else bill_date end ,
chrg_no,reg_no
having(sum(total)=0);
BEGIN
--打开游标
OPEN cr(pm_reg_no);
LOOP
--–-循环
FETCH cr
INTO V_cfh,v_cfrq,v_chrg_no,v_reg_no;
EXIT WHEN cr%NOTFOUND;
-- IF cr%NOTFOUND THEN
-- EXIT;
-- end if;
--更新语句(根据查询出来的结果集合)
update ip_bill b set yb_send_flag='1' where b.reg_no=v_reg_no and b.pre_no=v_cfh and b.bill_date=v_cfrq and b.chrg_no=v_chrg_no;
update ip_bill b set yb_send_flag='1' where b.reg_no=v_reg_no and b.old_pre_no=v_cfh and b.old_bill_date=v_cfrq and b.chrg_no=v_chrg_no;
end loop; --结束循环
CLOSE cr;
END p_ip_bill_tf
错误提示:
Compilation errors for PROCEDURE XGRMYY.P_IP_BILL_TF
Error: PLS-00103: 出现符号 "end-of-file"在需要下列之一时:
;
符号 ";" 被替换为 "end-of-file" 后继续。
Line: 33
Text: END p_ip_bill_tf