Syntax error: Missing 'integer' when creating stored Mysql files

Asked

Viewed 51 times

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;
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.