Last month I had a question on using the Buffer statement when looping over a file.
I tested this today and the result wasn’t what I expected, there was no increase in performance. I examined the traces before and after adding the Buffer statement and they are almost the same.
The only difference is that in the latter there is a line “Setting number of rows to fetch to 200 for Statement 03F7F430H” instead of fetch to 1. But still for each record there is a separate select statement and not just one as I was hoping for.
Simplified my code looks like this:
BUFFER(Lines,200)
LIN:HeaderID = HEA:HeaderID
LIN:Volgorde = 0
SET(LIN:Header_Volgorde_fkey,LIN:Header_Volgorde_fkey)
LOOP
NEXT(Lines)
IF ERRORCODE() THEN BREAK .
IF LIN:HeaderID <> HEA:HeaderID THEN BREAK .
DO Vul_Norm
IF ~HEA:WerknemerID THEN LIN:Uitvoering = 0 .
IF ~NumInspections THEN LIN:Inspectie = 0 .
IF ~HEA:WerknemerID OR ~NumInspections THEN PUT(Lines) .
END
Did I miss something in using the buffer statement when looping and updating a file?