关键是 它没有任何返回值
mysql := 'select max(a.num) from a,b where a.id = b.id';
execute immediate mysql into mynum;
if mynum is null then
-- no data found
end if;
...
mysql := 'select max(a.num) from a,b where a.id = b.id';
execute immediate mysql into mynum;
if mynum is null then
-- no data found
end if;
...
execute immediate mysql into mynum;时候就会出错,不知道是不是NULL不能into的吧
for r_gsa in c_gsa loopmysql := 'select nvl(unpay_fee,0) ' || ' from acc_bill_' || TO_CHAR(r_gsa.city_id) || ' where bill_month='||''''||to_char(add_months(SYSDATE,-1),'YYYYMM')||''''||' and acc_id='||r_gsa.acc_id ; --dbms_output.put_line(r_gsa.acc_id);
execute immediate mysql INTO unpayfee;
if unpayfee is NULL then
unpayfee := 0;
end if;end loop;