Re: circumventing limitations on the "Liimit" clause
Posted by:
Jo H.
Date: August 29, 2007 08:25AM
i tried this:
CREATE DEFINER = CURRENT_USER PROCEDURE `build_user_UsersByEmail`(IN `inApplicationName` VARCHAR(100), IN `inEmail` VARCHAR(100), IN `startIndex` INTEGER, IN `pageSize` INTEGER)
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
set @offset = startIndex;
set @size = pageSize;
prepare UsersByEmail from
SELECT PKID, Username, Email, PasswordQuestion,
`Comment`, IsApproved, IsLockedOut, CreationDate, LastLoginDate,
LastActivityDate, LastPasswordChangedDate, LastLockedOutDate
FROM Users
WHERE Email LIKE inEmail AND ApplicationName = inApplicationName
ORDER BY Username Asc LIMIT ?,?;
execute UsersByEmail using @offset, @size;
deallocate prepare UsersByEmail;
END;
but it would nto compile and i dont really know why.
Anyone any ideas?