问题描述
这是我的MysqL程序的一部分:
declare myCursor cursor for select body,id from posts where body like '%Possible Duplicate%' limit 10 offset 11;
DECLARE CONTINUE HANDLER
FOR NOT FOUND SET finished = 1;
open myCursor;
myloop: loop
fetch myCursor into mybody,myid;
if finished = 1 then leave myloop;
end if;
set Dupdup = 1;
set mytitle = regexp_substr(mybody,'.+?(?=</a>)');
select id into Dupdup from posts where title like mytitle;
update posts set dupicateId = Dupdup,isDuplicate = 1 where id = myid;
end loop myloop;
close myCursor;
我有一个很奇怪的问题。每当 select id into Dupdup from posts where title like mytitle;
不返回 id
时,它就会在下一次迭代中退出循环。我想 DECLARE CONTINUE HANDLER FOR NOT FOUND SET finished = 1;
在 select id into Dupdup from posts where title like mytitle;
不返回 id
时被执行。我想不出任何其他原因。
有没有办法解决这个问题?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)