我想创建一个能够执行多任务的存储过程。然后它在下面收到错误消息
Error Code: 1338 Cursor declaration after handler declaration
请看我的店铺流程
CREATE PROCEDURE `spTest`(OUT v1 VARCHAR(500), OUT v2 VARCHAR(500))
BEGIN
DECLARE _cur_1 CURSOR FOR
SELECT id
FROM tbl_1;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET _cur1Done = 1;
DECLARE _cur_2 CURSOR FOR
SELECT id
FROM tbl_2;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET _cur2Done = 1;
.......