For each statement single loop through date set

Posted by PeterWokke on 24-Feb-2016 00:38

Hello,

Within a for each loop I alter the same database table with a buffer on the table. Adding a sort order number with one.

It look like the altered items are processed more than once within the for each statement.

Is there an option on the for each loop so the selected records only processed once within the loop?

Kind regards,

Peter

All Replies

Posted by pgupta1974 on 24-Feb-2016 00:44

You could use PRESELECT in this case.
Thanks!
 
Puneet Gupta
 

Posted by PeterWokke on 24-Feb-2016 06:30

Hi Puneet,

Thank you kindly for this.

I have adjusted the FOR EACH to DO PRESELECT EACH statement.

After that FIND FIRST and DO WHILE AVAILABLE .... NEXT... END construction.

This works nice.

Kind regards,

Peter

Posted by PeterWokke on 24-Feb-2016 06:30

Hi Puneet,

Thank you kindly for this.

I have adjusted the FOR EACH to DO PRESELECT EACH statement.

After that FIND FIRST and DO WHILE AVAILABLE .... NEXT... END construction.

This works nice.

Kind regards,

Peter

This thread is closed