List:General Discussion« Previous MessageNext Message »
From:Jason Chan Date:October 10 2006 3:03pm
Subject: MySQL 5 SP question: can I use parameter in LIMIT clause?
View as plain text  
I want to write a sp return paging of recordset.

CREATE PROCEDURE `sp_GetJobsDetails`(Page INT, PageSize INT)
BEGIN
     DECLARE RecordBegin INT;
     DECLARE tmpPageSize INT;
     SET RecordBegin = Page * PageSize - PageSize;
     SET tmpPageSize = PageSize + 1;

     SELECT           JOB_ID
     FROM         JOB
     LIMIT RecordBegin, tmpPageSize;  <- this line cause error, does it 
supported?

END 



Thread
MySQL 5 SP question: can I use parameter in LIMIT clause?Jason Chan10 Oct