FireDAC In-Memory DataSet: TFDMemTable

More information and resources on TFDMemTable from the FireDAC Skill Sprint.

If you missed the Skill Sprint, or want to review it, here is the video with the recording of the Q&A. The presentation is 15-20 minutes, and the other 30 minutes is from the Q&A.

Here are the slides for now, the replay will be available soon.

Common code samples:

Delphi / Object Pascal

// Create Field Definitions
FDMemTable1.FieldDefs.Add('ID', ftInteger, 0, False);
FDMemTable1.FieldDefs.Add('Name', ftString, 20, False);
FDMemTable1.CreateDataSet;

// Append data
FDMemTable1.Open;
FDMemTable1.AppendRecord([1, 'Jim']);

// Load from another DataSet
FDMemTable1.CopyDataSet(DataSet1, [coStructure, coRestart, coAppend]);

C++

// Create Field Definitions
FDMemTable1->FieldDefs->Add("ID", ftInteger, 0, False);
FDMemTable1->FieldDefs->Add("Name", ftString, 20, False);
FDMemTable1->CreateDataSet();

// Append Data
FDMemTable1->Open();
FDMemTable1->Append();
FDMemTable1->FieldByName("ID")->AsInteger = 1;
FDMemTable1->FieldByName("Name")->AsString = "Jim";
FDMemTable1->Post();

// Load from another DataSet
FDMemTable1->CopyDataSet(DataSet1, TFDCopyDataSetOptions() << coStructure << coRestart << coAppend);

More information:

  • Samples
    • C:\Users\Public\Documents\Embarcadero\Studio\15.0\Samples\Object Pascal\Database\FireDAC\Samples\Comp Layer\TFDMemTable
    • C:\Users\Public\Documents\Embarcadero\Studio\15.0\Samples\Object Pascal\Database\FireDAC\Samples\Comp Layer\TFDLocalSQL
  • DocWiki

Cary Jensen’s CodeRage 9 Video: TFDMemTable & ClientDataSet¬†Compared [Q&A Log]

Dmitry Arefiev’s CodeRage 9 FireDAC Tips, Tricks and News

This entry was posted in Source Code, webinar. Bookmark the permalink.

One Response to FireDAC In-Memory DataSet: TFDMemTable

  1. Setup is easy, create your database, upload server side code, link objective c app to server code and you’re done. Your iOS source code must be ready. Your page is helpful!

Leave a Reply