Incorrect number of FETCH variables
来源:互联网 发布:微信windows手机版 编辑:程序博客网 时间:2024/06/04 18:57
在写存储过程,运行后提示“Incorrect number of FETCH variables”
原来是用游标select的字段数需要与fetch into的变量数一致
修改后的如下:
DROP PROCEDURE IF EXISTS modify_recommend_merchant;DELIMITER //CREATE PROCEDURE modify_recommend_merchant()BEGINDECLARE dat DATETIME DEFAULT DATE_SUB(NOW(), INTERVAL 1 DAY);DECLARE m_id INT;DECLARE done INT DEFAULT 0;DECLARE cur CURSOR FOR SELECT merchant_id FROM merchant WHERE is_recommend = 1 AND biz_type = 1 AND STATUS = 1;DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;OPEN cur;l1:LOOPFETCH cur INTO m_id;IF done = 1 THEN LEAVE l1;END IF;SET dat = DATE_ADD(dat, INTERVAL 1 SECOND);UPDATE merchant SET recommend_time = dat WHERE merchant_id = m_id;END LOOP l1;CLOSE cur;END//DELIMITER ;CALL modify_recommend_merchant;
0 0
- Incorrect number of FETCH variables
- Incorrect number of tokens found parsing file
- Invalid parameter number: number of bound variables does not match number of tokens
- [CF 279D]The Minimum Number of Variables[状压dp]
- cf-279D - The Minimum Number of Variables-数位dp
- ora-01789:query block has incorrect number of result columns
- ora-01789:query block has incorrect number of result columns
- ORA-27063: number of bytes read/written is incorrect
- SPSS modeler:Incorrect number of fields detected 解决方法
- ORA-01789:query block has incorrect number of result columns
- ORA-01789: query block has incorrect number of result columns
- Codeforces Round #171 (Div. 2) D. The Minimum Number of Variables
- Summary of Variables
- Specifying Attributes of Variables
- the variables of python
- Specifying Attributes of Variables
- Caused exception message is: ORA-01789: query block has incorrect number of result columns
- ora-01789:query block has incorrect number of result columns 错误
- 1040. Longest Symmetric String (25)【最长回文子串-马拉车(manacher算法)——PAT (Advanced Level) Practise
- linux操作oracle命令
- 机器人走迷宫
- Ubuntu更换网卡驱动
- 讲义15:存储过程
- Incorrect number of FETCH variables
- 讲义14:自定义函数
- ffmpeg tool 简单介绍
- TCP、UDP、HTTP、SOCKET之间的区别
- android的数据存储(一)
- 讲义13:流程控制
- 俄罗斯方块
- 1041. Be Unique (20)【水题】——PAT (Advanced Level) Practise
- 讲义12:批处理、脚本、变量