title: Why does my stored procedure throw error 'No data - zero rows fetched, selected, or processed' when I have a "WHERE" in the statement?
body: <p>I have double checked this select statement and it <em>definitely</em> returns rows:</p>
  
  <pre><code>SELECT name, id FROM MyTable WHERE id &gt; 3;
  </code></pre>
  
  <p>But when I do it for a cursor, it says no data fetched!</p>
  
  <pre><code>DROP PROCEDURE IF EXISTS Test;
  DELIMITER //
  
  CREATE PROCEDURE Test()
  BEGIN
  
      -- Our columns
      DECLARE name VARCHAR(45);
      DECLARE id INT DEFAULT -1;
  
      -- Our cursor
      DECLARE cur CURSOR FOR SELECT name, id FROM MyTable WHERE id &gt; 3;
  
      DROP TEMPORARY TABLE IF EXISTS TempTest;
      CREATE TEMPORARY TABLE TempTest
      (
      name VARCHAR(45) NOT NULL,
      id INT NOT NULL
      );
  
      -- Open our cursor
      open cur;
  
      -- Start our for loop
      forLoop: LOOP
  
      -- Get the row
      FETCH cur INTO name, id;
  
      INSERT INTO TempTest (name, id)
      VALUES ( name, id);
  
      END LOOP forLoop;
  
      -- Close the cursor
      CLOSE cur;
  
      -- NOW GET THE RESULTS
      SELECT * FROM TempTest;
  
  END; //
  
  DELIMITER ;
  
  CALL Test();
  </code></pre>
  
  <p>It throws the error:</p>
  
  <blockquote>
    <p>[1329] No data - zero rows fetched, selected, or processed</p>
  </blockquote>