Hi
I am trying to create a procedure that does a lot of stuff, but the error comes in when i try to execute the select statement and dynamicaly set the limit. The following is the procedure which gives the error.
DELIMITER ^
DROP PROCEDURE IF EXISTS `serverName`.`p rocedureName`^
CREATE PROCEDURE `serverName`.`p rocedureName` (nLimit INT)
BEGIN
SELECT column FROM tableName
order by column LIMIT nLimit OFFSET 0;
END^
DELIMITER ;
When i try the following, it works:
DELIMITER ^
DROP PROCEDURE IF EXISTS `serverName`.`p rocedureName`^
CREATE PROCEDURE `serverName`.`p rocedureName` (nLimit INT)
BEGIN
SELECT column FROM tableName
order by column LIMIT 5 OFFSET 0;
END^
DELIMITER ;
Any idea why the first one does not work??
Thanks in advance
I am trying to create a procedure that does a lot of stuff, but the error comes in when i try to execute the select statement and dynamicaly set the limit. The following is the procedure which gives the error.
DELIMITER ^
DROP PROCEDURE IF EXISTS `serverName`.`p rocedureName`^
CREATE PROCEDURE `serverName`.`p rocedureName` (nLimit INT)
BEGIN
SELECT column FROM tableName
order by column LIMIT nLimit OFFSET 0;
END^
DELIMITER ;
When i try the following, it works:
DELIMITER ^
DROP PROCEDURE IF EXISTS `serverName`.`p rocedureName`^
CREATE PROCEDURE `serverName`.`p rocedureName` (nLimit INT)
BEGIN
SELECT column FROM tableName
order by column LIMIT 5 OFFSET 0;
END^
DELIMITER ;
Any idea why the first one does not work??
Thanks in advance
Comment