This is a discussion on MySQL 5 SP question: can I use parameter in LIMIT clause? within the MySQL General forum forums, part of the MySQL category; --> I want to write a sp return paging of recordset. CREATE PROCEDURE `sp_GetJobsDetails`(Page INT, PageSize INT) BEGIN DECLARE RecordBegin ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |