[fpc-pascal] Coping a DataSet
Marcos Douglas
md at delfire.net
Mon Dec 3 19:27:32 CET 2012
On Mon, Dec 3, 2012 at 2:56 PM, silvioprog <silvioprog at gmail.com> wrote:
>
> 2012/12/3 Marcos Douglas <md at delfire.net>
>>
>> On Mon, Dec 3, 2012 at 2:32 PM, Michael Van Canneyt
>> <michael at freepascal.org> wrote:
>> >
>> >
>> > On Mon, 3 Dec 2012, Marcos Douglas wrote:
>> >
>> >> On Mon, Dec 3, 2012 at 2:03 PM, <michael.vancanneyt at wisa.be> wrote:
>> >>>
>> >>>
>> >>>
>> >>> On Mon, 3 Dec 2012, silvioprog wrote:
>> >>>
>> >>>> Guys,
>> >>>>
>> >>>> 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.
>> >
>> >
>> > 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.
>>
>> 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?
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
More information about the fpc-pascal
mailing list