Karen, make sure that the program has all variables declared outside the cursor loops, and that whileopt is OFF.
Albert

On 10/08/2012 8:16 AM, [email protected] wrote:
This client has a big database, needs to get to a 64-bit. The .rb2 file is usually 1.4 GB. However, they still have a major piece in DOS so we're still at 32-bit.

We haven't yet been able to successfully "convert" the one DOS piece to windows. This is a commission program they run once a month (I did not write this program nor design the database). The DOS program creates a temp table, loads about 50K rows into it, then runs a cursor through every single row. They typically copy the database to a local drive and run the program, later just loading the data to the permanent table in the live database. The cursor runs through hundreds of lines of code to figure out the commission and even calls a couple other subroutines for certain situations. It takes a few hours to run, but it works.

In Windows I've done the same thing -- copy the database to a local drive, step through the code. There are no errors generated, the code seems to work perfectly fine in windows. But at some point maybe 2/3 of the way through the cursors, the program will lock up. Never once have we gotten it to complete. I took the subroutine code and put it right in the cursor so that it wouldn't have to call other external programs. I changed it to be a permanent table rather than a temp table. Nothing so far has made it go all the way through.

I'm sure some of this code is maybe inefficient or can be replaced with some update commands up front that might make the code faster, but it probably won't diminish the number of rows to cursor through. I've never seen so much complicated machinations going on just to calculate a commission! I hope I don't have to try to understand this code and come up with alternatives! I'd like to just get the cursor to finish (admit it -- I'm lazy).

Anyone have ideas or settings I can try to get this thing to get through all rows? I have never before tried to run a cursor with this many rows!

Karen


No virus found in this message.
Checked by AVG - www.avg.com <http://www.avg.com>
Version: 2012.0.2197 / Virus Database: 2437/5190 - Release Date: 08/09/12



Reply via email to