Cached Updates and the order of commands

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Cached Updates and the order of commands

Post by Ludek » Fri 12 Dec 2008 08:45

Hi, in cached updates I need to first apply all inserts to the db, then the modifications and deletions. How can I do that?
Thanks, Ludek.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 12 Dec 2008 14:22

To solve this task you should handle the TMemDataSet.OnUpdateRecord event, which is rised when applying cached data.
You can find more detailed information about this event in the SDAC help.

Ludek
Posts: 296
Joined: Thu 12 Oct 2006 09:34

Post by Ludek » Sat 13 Dec 2008 13:39

That's what I wanted to have - change the order of records, that appers in the event - force deletions to be the last kind of updates in the event handler.
And that's not pissible, is it?

So there's only one way - to use uaSkip for deletions and call the ApplyUpdates twice - second time for the remaining ukDelete records... ?

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 16 Dec 2008 12:14

Yes, you are right. You can't do it directly - only by ApplyUpdates twice.

Post Reply