Hi,
What is the faster way to copy a DataSet to another? The FPC provides some functionality for this?
Thanks,
Marcos Douglas

Mailing lists / fpc-pascal / 2012-12
8 messages · 4 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
What is the faster way to copy a DataSet to another? The FPC provides some functionality for this?
Thanks,
Marcos Douglas
Guys,
Is "Assign" method implemented for dataset in FPC?
2012/12/3 Marcos Douglas
silvioprog wroteGuys, Is "Assign" method implemented for dataset in FPC?
No, it is not.
Datasets differ wildly in how they access and store data.
Michael.
But all descendents use TFieds classes so, why not? I can use a loop and the Append method, but this is not faster.
Marcos Douglas
Speed is not the issue.
There is simply no way to tell what this action will do behind the scenes.
You might for example generate a huge amount of queries, which will presumably all fail, since the records already exist in the database.
Then: Should the transaction be copied ? etc. etc. etc.
In short: it is not implemented, and I doubt it every will be, at least at the TDataset level.
When using a pure TBufDataset, probably it is possible to copy the data package (much like TClientDataset in Delphi), but this would need to be implemented.
Michael.
I guess I didn't understand you, sorry (thanks for the patience). I'm talking about copy the data only in memory. Do not is necessary check if record already exists.
Then: Should the transaction be copied ? etc. etc. etc.
I want, eg., copy a TZQuery (Zeos) to a TSQLQuery or TBufDataSet.
In short: it is not implemented, and I doubt it every will be, at least at the TDataset level.
I see.
Well, I wont to compare, but C# have ds.Copy and ds.Clone. I needed something like that.
http://msdn.microsoft.com/en-us/library/system.data.dataset.copy.aspx
When using a pure TBufDataset, probably it is possible to copy the data package (much like TClientDataset in Delphi), but this would need to be implemented.
Yes, like a TClientDataSet -- but I think this code is in midas.dll. The ClientDataSet copy data from whatever TDataSet descendent to him and this is fast.
Marcos Douglas
dbExpress, IBQuery or Zeos implements it?
2012/12/3 Marcos Douglas
I do not know about IBQuery or Zeos. The dbExpress, AFAIK, is used together TClientDataSet so, it no needs this functionality, I guess.
Marcos Douglas