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.