Consultor Eletrônico



Kbase 34367: When doing a FOR EACH on a table and changing data, the FOR EACH never terminates
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
Solution ID: P4367

SYMPTOM(s):

Using a FOR EACH statement to loop through records in a table

Changing value of fields during each iteration

Loop never terminates

CAUSE:

The reason why the FOR EACH is looping is because one of the fields that are being changed during each iteration is one of the fields that comprises the index or indexes that the FOR EACH is using to resolve the query.

FIX:

Specify a specific index using the USE-INDEX phrase. The index you specify must be one that is not being used to resolve the query for the FOR EACH statement.