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

Learn How Easy It Is To Map Dataset Columns With A Table Adapter In FireDAC For Delphi

The Commands sample shows you how to set up column mappings.

Location

You can find the MappingColumns sample project at:

How to Use the Sample

  1. Navigate to the location given above and open MappingColumns.dproj.
  2. Press F9 or choose Run > Run.
  3. Click on the Use Connection Definition combo box and select an option.

Files

File in DelphiContains
MappingColumns.dproj
MappingColumns.dpr
The project itself.
fMappingColumns.pas
fMappingColumns.fmx
The main form.

Implementation

To set up the columns mapping, the sample implements the following steps.

Create table adapter

[crayon-662db353b30f2194510601/]

Assign command

[crayon-662db353b3101492474029/]

Set source result set name

[crayon-662db353b3103690280638/]

Set the DatSTable name

Set the DatSTable name where the rows are fetched.

[crayon-662db353b3104859327107/]

Set the UpdateTable name

[crayon-662db353b3105749191620/]

Set the UpdateTable name

[crayon-662db353b3107589441994/]

Setup column mappings

[crayon-662db353b3108088063088/]

Fetch rows

[crayon-662db353b310d747295161/]

Update changes to RDBMS

To append rows, implement the following code:

[crayon-662db353b310e929359712/]

Then, the sample updates the changes to the RDBMS.

[crayon-662db353b310f865404637/]

Please go to the link below if you want to check the original post of Embarcadero for this sample:

http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.MappingColumns_Sample

Head over and check out the full source code for the dataset mapping column example for FireDAC in Delphi Windows development.

Exit mobile version