How to achieve efficient data exchange?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
zhbj
Posts: 11
Joined: Wed 10 Nov 2010 07:24

How to achieve efficient data exchange?

Post by zhbj » Thu 31 Jul 2014 02:05

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)

CristianP
Posts: 79
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

Re: How to achieve efficient data exchange?

Post by CristianP » Thu 31 Jul 2014 12:10

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

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: How to achieve efficient data exchange?

Post by ViktorV » Thu 31 Jul 2014 13:21

Yes, the use of TUniLoader give good result.

Post Reply