Page 1 of 1

How to achieve efficient data exchange?

Posted: Thu 31 Jul 2014 02:05
by zhbj
Use TUniQuery1 and TUniQuery2 (corresponding to different TUniConnection),
Use DisableControls,
Open TUniQuery1.UniDirectional: = true;
......
TUniQuery2.SQL.Add ('select * from tabl_de where 1 = 0');
......
Use loop assignment:
for N: = 1 to fieldcount-1 do
             Try
                TUniQuery2.Fields [N] .AsVariant: = TUniQuery1.Fields [N] .AsVariant;
......
Began operating normally, but if a large amount of data, the latter will appear "Out of memory" prompt,
is there a better solution for data exchange?
Thank you! 8)

Re: How to achieve efficient data exchange?

Posted: Thu 31 Jul 2014 12:10
by CristianP
If you do not want to reinvent the wheel then you can use TUniLoader.

Code: Select all

UniQuery1.Options.QueryRecCount := True;
......
UniLoader.TableName := 'tabl_de';
UniLoader.LoadFromDataSet(UniQuery1);
Best regards,
Cristian Peta

Re: How to achieve efficient data exchange?

Posted: Thu 31 Jul 2014 13:21
by ViktorV
Yes, the use of TUniLoader give good result.