Aha... it never occurred to me that I'd keep the cursor and just replace the while loop. So would it go something like this:
declare c1 cursor for select .... open c1 label again fetch c1 into ... if sqlcode = 100 then goto end endif -- processing code goes here goto again label end return Karen In a message dated 9/11/2012 6:30:58 PM Central Daylight Time, [email protected] writes: > You aren't replacing the Cursors, just the While / Endwhile construct. > you put a Label at the location normally occupied by the While. > A GoTo at the location of the EndWhile. > Do your test for the continuation in either location as appropriate... > You are still going to use a cursor, so the SqlCode generated by the FETCH > > will still be valid for the continuation. > > I think before you massage it to the smaller size, just set the test in > motion to see if it is indeed the while loops crapping out on you because > > of memory leaks.

