title: mysql stored procedure: using declared vars in a limit statement returns an error
body: <p>I have the following code:</p>
  
  <pre><code>delimiter ;
  
  DROP PROCEDURE IF EXISTS ufk_test;
  delimiter //
  CREATE PROCEDURE ufk_test(IN highscoreChallengeId INT UNSIGNED)
  BEGIN
  DECLARE vLoopOrder INT UNSIGNED DEFAULT 5;
  DECLARE vLoopLimit INT UNSIGNED DEFAULT 10;
  select * from fb_user LIMIT vLoopOrder,vLoopLimit;
  END//
  
  delimiter ;
  </code></pre>
  
  <p>Mysql returns the following error:</p>
  
  <pre><code>ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'vLoopOrder,vLoopLimit;
  END' at line 11
  </code></pre>
  
  <p>it seems that I cannot use declared variables in a LIMIT statement. is there any other way to overcome this ?</p>
  
  <p>of course this is a simple example, here i could just put static numbers but I need to know if it's possible in any way to use any kind of variables with LIMIT.</p>
  
  <p>Thanks</p>