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

Reply via email to