Connecting Tech Pros Worldwide Forums | Help | Site Map

Problem with cursors

Newbie
 
Join Date: Jun 2008
Posts: 18
#1: Oct 8 '09
When i am trying to loop through cursor using a not found continue handler I am facing a problem, for a select staement inside cursor loop the not found condition is getting true and hence the cursor loop is also getting completed

Expand|Select|Wrap|Line Numbers
  1.    DECLARE CONTINUE HANDLER FOR NOT FOUND 
  2.    SET at_end=1;
  3.    OPEN C1;     
  4.    FETCH C1 INTO perm;
  5.    WHILE at_end = 0 DO
  6.     <some select statement   which returns null some time> 
  7.     <when null is returned the continue handler set at_end=1>.. :(
  8.   FETCH C1 INTO perm
  9. END WHILE;
  10.    CLOSE C1;

Reply