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. ----- Original Message ----- From: <[email protected]> To: "RBASE-L Mailing List" <[email protected]> Sent: Tuesday, September 11, 2012 6:24 PM Subject: [RBASE-L] - Cursor ideas : Remember a while ago I was asking for ideas about a gigantic cursor that : would error out at some point. Probably within a month I'll need to start : work on this. : : The most popular suggestion was to replace the cursor loops with a bunch of : "goto". I've never used Goto for big processes like this, just simple : program movements. My first cursor (the biggest one) is through a table with : over 100,000 rows, but the cursor has a where clause so it steps through : about half of them. There is an autonumbered column in the table. : : So trying to avoid a "while" loop of any kind, how could I structure the : "goto" code? Do I grab a minimum/maximum autonumber that my cusor would have : gone through, increment it by one to see if there's anything to process (in : which case there will be thousands of autonumbers that I will increment but : not process; I guess that's okay as long as the program does work). : : My other thought is that I could make a permanent working table and load it : with the rows that I would have cursored through, put a fresh autonumber : column on that table and then step through that table. There are other : cursors to other tables based on these rows, so I have to also think of ways to : convert those into non-cursors (or maybe those will be okay as long as I : remove the upper level one). : : Suggestions again? : : Karen : :

