MySQL cursor not working with Stored Procedure
<p>I wrote store procedure in mysql. Step were followed this website <a href="http://www.mysqltutorial.org/mysql-cursor/" rel="nofollow">http://www.mysqltutorial.org/mysql-cursor/</a>
But it doesn't work. Here is code</p>

<hr>

<pre><code>DELIMITER $$

USE `hr`$$

DROP PROCEDURE IF EXISTS `at_getShift`$$

CREATE DEFINER=`root`@`%` PROCEDURE `at_getShift`()

BEGIN

    DECLARE finished BOOLEAN DEFAULT FALSE;
    DECLARE employeeID VARCHAR(255);-- Default "";

    -- declare cursor for employee email
    DECLARE hrEmployee CURSOR FOR SELECT EmployeeID FROM h_employees WHERE EmployeeID IN ('100013', '100014');

    -- declare NOT FOUND handler
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET finished = TRUE;

    DROP TABLE IF EXISTS temp;
    CREATE TABLE IF NOT EXISTS temp(
      `Code` VARCHAR(255)
    );  

    OPEN hrEmployee;

    get_employee: LOOP
    FETCH hrEmployee INTO employeeID;
    INSERT INTO temp(`Code`) VALUE (employeeID);
    -- If no any row, leave loop
    IF finished THEN 
        INSERT INTO temp(`Code`) VALUE ("112");
        CLOSE hrEmployee;
        LEAVE get_employee;
    END IF;

    -- insert temp
    INSERT INTO temp(`Code`) VALUE ("111");
    END LOOP get_employee;

    SELECT * FROM temp;
END$$

DELIMITER ;
</code></pre>

<hr>

<p>Execute: <code>CALL at_getShift();</code></p>

<p>Result is:</p>

<blockquote>
  <p>2 rows in temp table ( 1 null, 1 is 112)</p>
</blockquote>

<p>Please kindly help me to resolve this trouble. </p>