[Stackoverflow] [Progress OpenEdge ABL] Copy some table records into the same table make some problems

  • Thread starter Thread starter JulesVerne
  • Start date Start date
Status
Not open for further replies.
J

JulesVerne

Guest
Code:
DEFINE BUFFER bfSource FOR tableA.
DEFINE BUFFER bfTarget FOR tableA.

DO FOR bfTarget TRANSACTION:
    FOR EACH bfSource  WHERE  bfSource.user_id = 0 NO-LOCK:
        CREATE bfTarget.
        BUFFER-COPY bfSource  EXCEPT id TO bfTarget.
        ASSIGN 
            bfTarget.user_id = 1.
    END.
END.

When i use this query the last iteration can randomly couse some problems. The AVM try to find the next record, but their is none, sometimes the AVM finds the new created record (before the user_id is <> 0). I have some ideas to prevent this , horribil to find, bug, but i dont know what is best practise. I also tryed to change the position of the transaction scope with no effect.

Continue reading...
 
Status
Not open for further replies.
Back
Top