The Podcast at Delphi.org

The Podcast about the Delphi programming language, tools, news and community.

12 2015

FireDAC In-Memory DataSet: TFDMemTable

by Jim McKeeth

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.

[embed]https://www.youtube.com/watch?v=TEP4WcXNpAg[/embed]

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

http://www.slideshare.net/jimmckeeth/skill-sprint-in-mem-dataset

Common code samples:

Delphi / Object Pascal

[delphi] // 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]); [/delphi]

C++

[cpp] // 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);

[/cpp]

More information:

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

https://www.youtube.com/watch?v=iNgHJakYWkU

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

http://www.youtube.com/watch?v=gljfudAKlTI 

tags: Source Code - webinar