title: MySQL - Error #1193 - Unknown system variable 'FETCH_STATUS'
body: <p>I having above error while creating process while creating following stored procedure. Please help me to solve this problem.Definition of stored procedure is given below. Thank in advance</p>
  
  <p>Here is my code</p>
  
  <pre><code>DELIMITER $$
  DROP PROCEDURE IF EXISTS 
  
  `sp_rpt_process_status`$$
  
  
  CREATE DEFINER=`saumitra`@`localhost` PROCEDURE `sp_rpt_process_status`()
  BEGIN
  
  DECLARE reqs_id INT(11);
  DECLARE app_id INT(11);
  DECLARE ap_name varchar(100);
  
  declare cur CURSOR for
      select table_id from aerion.rpt_process where table_update='dev_est_reqs';
  
  open cur;
  
  fetch next from cur into reqs_id;
  
  while     @@FETCH_STATUS = 0 BEGIN
  
      SELECT iddev_est INTO est_id, iddev_apps INTO app_id from aerion.dev_est where iddev_est_reqs=reqs_id;
      SELECT app_name INTO ap_name FROM dev_apps WHERE iddev_apps=app_id;
      INSERT INTO `rpt_dev_status`(`rpt_dev_app`) VALUES (ap_name); 
      fetch next from cur into reqs_id;
  
  END
  
  close cur
  deallocate cur
  
  END$$
  
  DELIMITER ;
  </code></pre>