MySQL: Calling a Stored Procedure Within a Cursor Loop, Without Tripping the Continue Handler
I am trying to call a Stored Procedure in MySQL within the loop of a Cursor.  The cursor behaves properly when doing an INSERT in the loop; but if I try to call a Stored Procedure, the continue Handler 'sets done = 1' and will exit the loop prematurely, after the first record is processed.  Any thoughts on how to work around this?  Thanks.

    declare test_cursor cursor for 
           select projectid, projectdesc
             from tblProjects
            order by projectdesc;          

    DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;

    set done = 0;  
    open test_cursor;
       
    repeat

      fetch trade_cursor into wprojectid, wprojectdesc;

      if not done then  

        insert into tblTest (a, b) values wprojectid, wprojectdesc;   <--this would work
        call spTest(a, b, @retrn);                                    <--this trips the Handler after first loop
        
      end if;      
      
    until done end repeat;
      
    close test_cursor; 
MySQL: Calling a Stored Procedure Within a Cursor Loop, Without Tripping the Continue Handler
===

I am trying to call a Stored Procedure in MySQL within the loop of a Cursor.  The cursor behaves properly when doing an INSERT in the loop; but if I try to call a Stored Procedure, the continue Handler 'sets done = 1' and will exit the loop prematurely, after the first record is processed.  Any thoughts on how to work around this?  Thanks.

    declare test_cursor cursor for 
           select projectid, projectdesc
             from tblProjects
            order by projectdesc;          

    DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;

    set done = 0;  
    open test_cursor;
       
    repeat

      fetch trade_cursor into wprojectid, wprojectdesc;

      if not done then  

        insert into tblTest (a, b) values wprojectid, wprojectdesc;   <--this would work
        call spTest(a, b, @retrn);                                    <--this trips the Handler after first loop
        
      end if;      
      
    until done end repeat;
      
    close test_cursor; 