mysql stored procedure: using declared vars in a limit statement returns an error

前端 未结 1 1262
伪装坚强ぢ
伪装坚强ぢ 2021-01-07 08:58

I have the following code:

delimiter ;

DROP PROCEDURE IF EXISTS ufk_test;
delimiter //
CREATE PROCEDURE ufk_test(IN highscoreChallengeId INT UNSIGNED)
BEGIN         


        
1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-07 09:14

    i use something like:

    SET @s = CONCAT('SELECT * FROM table limit  ', vLoopOrder ', ', vLoopLimit); 
    PREPARE stmt1 FROM @s; 
    EXECUTE stmt1; 
    DEALLOCATE PREPARE stmt1;
    

    0 讨论(0)
提交回复
热议问题