游标可以嵌套循环吗?

margg margg 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
boolean lb_continue6,lb_6
declare cu_pcn6 cursor for
select id,p_cn from user_m where s_cn = :ls_pcn5;
open cu_pcn6;
Do while lb_continue6
Fetch cu_pcn6 into :li_userid6,:ls_pcn6;
if sqlca.sqlcode = 0 then
declare cu_assess6 cursor for
select assess from orderbill
where userid = :li_userid6
and year(makedate) = :li_year
and month(makedate) = :li_month ;
open cu_assess6;
Do while lb_6
Fetch cu_assess6 into :ld_assess6;
if sqlca.sqlcode = 0 then ld_total6 = ld_total6 + ld_assess6
else
lb_6 = false
end if
Loop
close cu_assess6;
else
lb_continue6 = false
end if
Loop
close cu_pcn6;
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
margg
PowerBuilder 1,111 成员 66,454 内容