0

I'm getting this error from my MYSQL query and I don't know how to fix it.

****E*RROR 1064: 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 'var1; END' at line 3*****

MYSQL

USE `test`;
DROP procedure IF EXISTS `my_proc_IN`;

DELIMITER $$
USE `test`$$
CREATE PROCEDURE my_proc_IN (IN var1 INT)
BEGIN
SELECT * FROM jobs_TABLE LIMIT var1;
END$$

DELIMITER ;
Neil
  • 14,063
  • 3
  • 30
  • 51
  • Try replace ';' after SELECT with '$$'. You have overloaded delimiter at line 4. – sphinks Mar 14 '17 at 11:13
  • tried it, but getting same error in mysql workbench tool – mahesh reddy Mar 14 '17 at 15:09
  • 1
    This http://stackoverflow.com/questions/245180/variable-limit-clause-in-mysql (first google search) indicate limit can't use a variable. This https://forums.mysql.com/read.php?98,126379,133966#msg-133966 appears to show a workaround – Nick.Mc Mar 17 '17 at 02:20

0 Answers0