Imagine you have a table, let's call it MyRec, primary key "Entry No."
You run some kind of processing on it, and when an entry gets processed a temporary entry TempMyRec is inserted with the same Entry No.
When the processing has finished you want to update your MyRec with "Processed" flag.
The most obvious way of doing it (to me) would be
IF TempMyRec.FINDSET THEN REPEAT
MyRec.GET(TempMyRec."Entry No.");
MyRec.Processed := TRUE;
MyRec.MODIFY;
UNTIL TempMyRec.NEXT = 0;
Slight problem is if you have millions of records this may lock MyRec table for long time causing problems for other users.
So I thought of an alternative:
IF TempMyRec.FINDSET THEN REPEAT
MyRec.GET(TempMyRec."Entry No.");
MyRec.MARK := TRUE;
UNTIL TempMyRec.NEXT = 0;
MyRec.MARKEDONLY;
MyRec.MODIFYALL(Processed,TRUE);
Question: will this lock the table for shorter time or will it not make any difference?
You run some kind of processing on it, and when an entry gets processed a temporary entry TempMyRec is inserted with the same Entry No.
When the processing has finished you want to update your MyRec with "Processed" flag.
The most obvious way of doing it (to me) would be
IF TempMyRec.FINDSET THEN REPEAT
MyRec.GET(TempMyRec."Entry No.");
MyRec.Processed := TRUE;
MyRec.MODIFY;
UNTIL TempMyRec.NEXT = 0;
Slight problem is if you have millions of records this may lock MyRec table for long time causing problems for other users.
So I thought of an alternative:
IF TempMyRec.FINDSET THEN REPEAT
MyRec.GET(TempMyRec."Entry No.");
MyRec.MARK := TRUE;
UNTIL TempMyRec.NEXT = 0;
MyRec.MARKEDONLY;
MyRec.MODIFYALL(Processed,TRUE);
Question: will this lock the table for shorter time or will it not make any difference?