Wednesday, October 5, 2011

My SQL LIMIT Clause gives problems with Stored Procedure

I found the following workout.

CREATE PROCEDURE GET_SOMETHING ( IN paraFrom INT , IN paraPage INT )

BEGIN
    SET @SQL = CONCAT("SELECT * FROM customers LIMIT ",paraFrom" , ",paraPage ) ;
    PREPARE stmt FROM @sql; execute stmt;
END

Post a Comment