Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Learn How Easy It Is To Apply Updates With TFDQuery.OnUpdateRecord In Delphi

The OnUpdateRecord sample shows you how to cache the user changes when using read-only dataset and then, how to apply updates on behalf of queries that cannot post updates directly. To this end, the sample uses the OnUpdateRecord event of TFDQuery and the TFDUpdateSQL object.

Location

You can find the CentralizedCachedUpdates sample project at:

How to Use the Sample

  1. Navigate to the location given above and open Qry_CachedUpdates.dproj.
  2. Press F9 or choose Run > Run.

Files

File in DelphiContains
Qry_CachedUpdates.dproj
Qry_CachedUpdates.dpr
The project itself.
fCachedUpdates.pas
fCachedUpdates.fmx
The main form.

Implementation

Before running the sample, the main components are configured at design time using the Object Inspector as follows:

[crayon-6767e7dd10da2744630718/]

Note: In the RDBMS it has one-to-many relation between Categories and Products tables.

[crayon-6767e7dd10daa348057264/] [crayon-6767e7dd10dac666894629/]

For more details, please follow the link to the original post:

http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.TFDQuery.OnUpdateRecord_Sample

Head over and check out the OnUpdateRecord sample source code for Delphi over on GitHub.

Exit mobile version