I have a SelectProc procedure that contains a SELECT statement. I want to add a LimitRowsCount procedure parameter and use it as follows:
CREATE PROCEDURE SelectProc (IN LimitRowsCount INTEGER UNSIGNED)
BEGIN
SELECT (...)
LIMIT LimitRowsCount;
END
but this approach does not work.
SELECT itself contains nested subqueries, so I cannot create a view from it. Is there a way more propper and then dynamic SQL (prepared statements)?
source
share