gpt4 book ai didi

mysql - 1329 无数据 - 提取、选择或处理的行为零

转载 作者:行者123 更新时间:2023-11-30 23:29:40 24 4
gpt4 key购买 nike

我已经多次更改此存储过程,但仍然不断出现相同的错误。我知道我正在取回行,因为我单独测试了游标选择。我已阅读此站点上的其他类似问题,但我似乎没有相同的修复方法。

DECLARE iDone INTEGER(10) DEFAULT 0; 
DECLARE userID INTEGER(10);
DECLARE creditRemaining INTEGER(10);

DECLARE column_cur CURSOR FOR
SELECT `userID`, `creditRemaining` FROM `access`
WHERE (`dateExpire`>=now() OR `isRenewed`=1) and `descriptionShort`='Subscription';

DECLARE CONTINUE HANDLER FOR NOT FOUND SET iDone=1;

SET userID = 0;
SET creditRemaining = 0;
OPEN column_cur;
LOOP1: LOOP

FETCH column_cur INTO userID, creditRemaining;
IF iDone = 1
THEN
LEAVE LOOP1;
END IF;
-- SELECT userID, creditRemaining;
UPDATE `users` SET `saveCount`=creditRemaining, `searchCount`=6000 WHERE `ID`=userID;

END LOOP LOOP1;
CLOSE column_cur;

最佳答案

我认为这是 more 的重复,除了你已经声明了一个 HANDLER 之外。在另一个 Error 1329 问题中,this answer来自@DanJGer 指出了文档中的注释:

Before MySQL 5.6.3, if a statement that generates a warning or error causes a condition handler to be invoked, the handler may not clear the diagnostic area. This might lead to the appearance that the handler was not invoked. The following discussion demonstrates the issue and provides a workaround.

这可能就是您遇到的问题。

关于mysql - 1329 无数据 - 提取、选择或处理的行为零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11367251/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com