title: How to repeate mysql cursor with parameter?
body: <p>I have following cursor with parameter. Now I need to set parameter during loop. Is their a short way to do this?</p>
  
  <p><em>Cursor:</em></p>
  
  <pre><code>DECLARE curs1 CURSOR FOR 
       SELECT  USER_ID,affiliate_id
   FROM `wpmr_aff_referrals` WHERE affiliate_id=AFFILIATEID;
  </code></pre>
  
  <p><em>Cursor body part:</em></p>
  
  <pre><code>OPEN curs1;    
  read_loop : LOOP    
  FETCH curs1 INTO USERID,AFFILIATEID;
  IF (vCNT&gt;=3) THEN  
  set AFFILIATEID=10;
  ELSE
  set new.affiliate_id= 5;
  END IF;    
  END LOOP read_loop;
  CLOSE curs1;
  </code></pre>
  
  <p>At <code>set AFFILIATEID=10;</code> it should be re-opened like in Oracle we do open cursor as <code>c_emp (23);</code></p>