Archive for June, 2008

We are sinking!

Post to Twitter Tweet This

I think there’s a spy among us

I think there's a spy among us

Post to Twitter Tweet This

MySQL: passing limits as stored procedure parameters

Unfortunately MySQL 5 (at least 5.0.15) does not allow using variables or procedure parameters with LIMIT.

Here is a workaround where SQL statement is generated inside stored procedure:

CREATE PROCEDURE GetList (limitStart int, limitCount int)
BEGIN
 
SET @sql = CONCAT('SELECT ID, Name FROM `User`
LIMIT ', limitStart, ', ', limitCount);
 
PREPARE query FROM @sql;
EXECURE query;
DEALLOCATE PREPARE query;
 
END;

Post to Twitter Tweet This

IKEA job interview

Post to Twitter Tweet This

Business hours

Post to Twitter Tweet This