1
While trying to create the stored file below, I get the title error in
line containing: Kill Nid;
What am I 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;