VirtualTable and UpdateSql

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
AnHa
Posts: 8
Joined: Wed 09 Feb 2011 13:42

VirtualTable and UpdateSql

Post by AnHa » Wed 09 Feb 2011 16:01

I'd like to populate a memory-table with data from a complicated query. After that I need the user-changes from this memory-table written to the DB-Server. My first try was a TVirtualTable (perfect for populating) connected to a TUniUpdateSql (perfect for Updating). But that is not possible.
Is there a other way to mirror changes in a TVirtualTable to Sql-Statements?
Can I populate a TUniQuery manually and only use CachedUpdates for userchanges after that point?

Andreas

99Percent
Posts: 48
Joined: Tue 13 Sep 2005 05:34

Re: VirtualTable and UpdateSql

Post by 99Percent » Sat 12 Feb 2011 02:53

Use a TUniQuery and then enter a specific update query (SQLUpdate property)
AnHa wrote:I'd like to populate a memory-table with data from a complicated query. After that I need the user-changes from this memory-table written to the DB-Server. My first try was a TVirtualTable (perfect for populating) connected to a TUniUpdateSql (perfect for Updating). But that is not possible.
Is there a other way to mirror changes in a TVirtualTable to Sql-Statements?
Can I populate a TUniQuery manually and only use CachedUpdates for userchanges after that point?

Andreas

AndreyZ

Post by AndreyZ » Mon 14 Feb 2011 14:41

Hello,

Thank you, 99Percent, for your help.
You can use the TUniQuery component with the CashedUpdates option set to True. In this case you will have all user changes in the memory and will be able to send data to the server using the ApplyUpdates method. If you have a very complicated query, you can use the SQLUpdate property to specify a SQL statement that will be used when applying an update to a dataset.

Post Reply