• While this shouldn't loop forever, I imagine you actually want something different. First, you are not using the value read by the cursor. The statement of INSERT INTO... will read from the entire table of junkgood for each row. It probably seems like the program is looping forever because of the duplicates. Which brings me to the second point. Unless you are actually doing a lot of other specific processing, you can remove all the cursor code and just execute the INSERT INTO statement. It is much preferred to just use the entries as a batch.

    Hope this clarifies things.

    Guarddata-