Hello
I have a large table and I need to Fetch all records of it.
Is there any way of telling MsQuery that I want to dispose some data I already read? Let me explain this better:
Suppose I need to loop through all lines of a MSQuery using EOF and NEXT , but setting FetchAll to True. Inside this loop I am doing some processing with this data and a record already processed does not need to stay in the memory, so I would like to tell MsQuery that it can dispose that record. I know it sounds odd, but is it possible?
FetchAll := True and memory usage
-
AndreyZ
Hello,
You can set the FetchAll property to False and the UniDirectional property to True. Here is an example:In this case all memory of data that was read will be released automatically. Note that you cannot modify data, only read in one direction. For more information about the UniDirectional property, please refer to the SDAC documentation.
You can set the FetchAll property to False and the UniDirectional property to True. Here is an example:
Code: Select all
MSTable.FetchAll := False;
MSTable.UniDirectional := True;
MSTable.Open;
while not MSTable.Eof do begin
// data reading
MSTable.Next;
end;-
AndreyZ