Comment Never seen this before on a FOR EACH statement.

Cecil

19+ years progress programming and still learning.
This is a first for me. I was looking at some code today and saw this:

Code:
       FOR EACH ttSomeTempTable NO-LOCK
                WHERE ttSomeTempTable.randomFieldName NE ""
                AND   ttSomeTempTable.randomFieldName NE ?
                BREAK BY ttSomeTempTable.randomFieldName
                ON ERROR UNDO UpdateBlock, LEAVE:
             
                /** CODE GOES HERE... **/
             
        END.

I don't think I have ever seen ON ERROR UNDO UpdateBlock, LEAVE as part of the FOR EACH statement.

20 years of Progress programming and I have learned something new. I guess we all get so used to what we *think* we know, that we never RTFM.
 

Cringer

ProgressTalk.com Moderator
Staff member
Definitely seen it before, but I wouldn't be too happy about the transaction scoping here. That suggests there's a big transaction we want to back out on an error in the subsequent for each. Sounds like it could be a lock table nightmare. I know you're using a temp table, but it's possible to do it on a DB table too.
 

tamhas

ProgressTalk.com Sponsor
It would be interesting to know where the block label was relative to the FOR EACH...
 
Top