When trying to create the stored procedure below, I get the title error in
line containing: kill nID;
What I'm doing wrong:
DELIMITER //
DROP PROCEDURE IF EXISTS ClearDB//
CREATE PROCEDURE ClearDB()
BEGIN
DECLARE nID, bCursor int;
DECLARE cursorQuery CURSOR FOR
SELECT ID
FROM information_schema.processlist
WHERE 'TIME' > 1200;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET bCursor = 1;
OPEN cursorQuery;
SET bCursor = 0;
WHILE bCursor = 0 DO
FETCH cursorQuery INTO nID;
kill nID;
END WHILE;
CLOSE cursorQuery;
END //
DELIMITER;