Union Tables Sample
This sample uses Unions defined in the server's Schema to fetch data from several tables in the back-end
database that is seamlessly combined and available to the client as a unified data table.
Note how the Union table contains an additional @SourceTable field to indicate the original table,
and how by filling the @SourceTable field with the appropriate value when inserting new records,
those records can automatically be updated into the appropriate back-end table.
Examine the code
-
Take a look at the TClientForm.btLoadClick method to see how the data is loaded.
Note that the calculated field SourceTableName is not loaded from the server.
- See the TClientForm.btUpdateClick event handler, where the dataset is updated.
-
Look at the piece of code in TClientForm.btUpdateClick method related to filter.
See how Dynamic Where conditions are applied to the Union Tables.
Dynamic Where conditions work fine against union tables.
-
Examine properties of the RemoteDataAdapter.
Note that its DataStreamer.SendReducedDelta and DynamicSelect properties are both set to true.
Getting started
- Run the Sample Server.
- Run the Union Tables Sample.
- Try to fill DataSet.
- Try to change some records.
- Apply changes to the server using the Update button.
- Examine the Sql command used to load and update data (in the server log).
-
Try to apply simple DynamicWhere condition like 'fr'. Examine the server log to see how the data is loaded from two
different physical tables using the provided condition.