oracle存储过程应该怎么转到sql server

哎呦喂哈 哎呦喂哈 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

CREATE OR REPLACE PROCEDURE pro_paper_auto_make3_1(
p_plan_id number
)
is

v_point_per number(5,1);
v_question_no_b number;
v_difficult_y number;
v_difficult_z number;
v_difficult_n number;
v_question_type varchar2(8);

v_question_id number;

j number default 0;
k number default 0;
v_kong_num number default 0;

cursor cur_plan_detail is
select
c.question_no_b,c.point_per, c.difficult_y,c.difficult_z,c.difficult_n,c.type
from t_test_plan a,t_test_paper_question_b c
where a.id = c.plan_id
and a.id = p_plan_id
order by question_no_b
;

begin
delete from t_test_paper_question_temp where paper_id=p_paper_id;
open cur_plan_detail;
loop <<planloop>>
fetch cur_plan_detail into v_question_no_b,v_point_per,v_difficult_y,v_difficult_z,v_difficult_n,v_question_type;
exit when cur_plan_detail%notfound;


j:=1;
k:=1;

begin

while j<=v_difficult_y+v_difficult_z+v_difficult_n loop <<difficult_loop>>

......

end loop difficult_loop;

end;

end loop planloop;
close cur_plan_detail;

commit;

end;


大家帮忙看下、是不是sql server 里没有loop循环啊? 如果没有的话那应该怎么改?

主要说下loop 循环 和 while 循环那块应该怎么改就行了
...全文
评论 6
收藏 已收藏
分享
返回顶部
哎呦喂哈
Web 开发 81,107 成员 341,720 内容