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

<br />
// Create Field Definitions<br />
FDMemTable1.FieldDefs.Add('ID', ftInteger, 0, False);<br />
FDMemTable1.FieldDefs.Add('Name', ftString, 20, False);<br />
FDMemTable1.CreateDataSet;</p>
<p>// Append data<br />
FDMemTable1.Open;<br />
FDMemTable1.AppendRecord([1, 'Jim']);</p>
<p>// Load from another DataSet<br />
FDMemTable1.CopyDataSet(DataSet1, [coStructure, coRestart, coAppend]);<br />

C++

<br />
// Create Field Definitions<br />
FDMemTable1-&gt;FieldDefs-&gt;Add(&quot;ID&quot;, ftInteger, 0, False);<br />
FDMemTable1-&gt;FieldDefs-&gt;Add(&quot;Name&quot;, ftString, 20, False);<br />
FDMemTable1-&gt;CreateDataSet();</p>
<p>// Append Data<br />
FDMemTable1-&gt;Open();<br />
FDMemTable1-&gt;Append();<br />
FDMemTable1-&gt;FieldByName(&quot;ID&quot;)-&gt;AsInteger = 1;<br />
FDMemTable1-&gt;FieldByName(&quot;Name&quot;)-&gt;AsString = &quot;Jim&quot;;<br />
FDMemTable1-&gt;Post();</p>
<p>// Load from another DataSet<br />
FDMemTable1-&gt;CopyDataSet(DataSet1, TFDCopyDataSetOptions() &lt;&lt; coStructure &lt;&lt; coRestart &lt;&lt; coAppend);</p>
<p>

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.