MYSQL存储过程问题

mrfish45 2010-10-26 06:09:20
CREATE DEFINER=`root`@`localhost` PROCEDURE `deleteResult`(IN check_id int(8))
begin
declare done int default 0;
DECLARE l_page_id int(8);
DECLARE l_vul_id int(8);
DECLARE page_cur CURSOR FOR select page_id from page where check_id=check_id;
DECLARE vul_cur CURSOR FOR select vul_id from vul where page_id=l_page_id;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;

OPEN page_cur;
page_loop: LOOP
FETCH page_cur into l_page_id;
IF done=1 THEN
LEAVE page_loop;
END IF;
OPEN vul_cur;
vul_loop: LOOP
FETCH vul_cur into l_vul_id;
IF done=1 THEN
LEAVE vul_loop;
END IF;
delete from vul where vul_id=l_vul_id;
delete from checkmap where vul_id=l_vul_id;
delete from reqheadvul where vul_id=l_vul_id;
delete from resheadvul where vul_id=l_vul_id;
END LOOP vul_loop;
CLOSE vul_cur;
delete from page where page_id=l_page_id;
delete from method where page_id=l_page_id;
delete from guavul where page_id=l_page_id;
END LOOP page_loop;
CLOSE page_cur;

delete from checkmodel where check_id=check_id;
delete from tree where check_id=check_id;
delete from site where check_id=check_id;
END

为什么我进不了第二个游标里面
其他都没问题啊
...全文
75 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
抢街饭 2010-11-11
圣兽山
回复
toulanggejiguang 2010-11-08
lalal
回复
相关推荐
发帖
PHP
创建于2008-08-27

1.9w+

社区成员

“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
申请成为版主
帖子事件
创建了帖子
2010-10-26 06:09
社区公告
暂无公告