现象:
如下pl/sql 块一直处于执行状态
DECLARE
...
...
curr_distr_no varchar2(10);
BEGIN
for rec in cur loop
if rec.distr_no <> curr_distr_no then final_amount := 0;
end if;
final_amount := rec.amount + final_amount;
update d set remain_amount = to_char(final_amount) where sn = rec.sn and distr_no = rec.distr_no;
curr_distr_no := rec.distr_no;
end loop;
END;
解决:
BEGIN
for rec in cur loop
if rec.distr_no <> curr_distr_no then final_amount := 0;
end if;
final_amount := rec.amount + final_amount;
update d set remain_amount = to_char(final_amount) where sn = rec.sn and distr_no = rec.distr_no;
curr_distr_no := rec.distr_no;
end loop;
END;
解决:
curr_distr_no varchar2(10); 改为 curr_distr_no varchar2(10) :='';
Link URL: http://hi.erp100.com/home.php?mod=space&uid=55664&do=blog&id=13571502
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13964895/viewspace-735556/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13964895/viewspace-735556/