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

Easily Optimize Multiple SQL INSERT Commands In A Single Step With Array DML In Delphi

The Batch sample shows you how to use the Array DML execution technique to execute multiple SQL INSERT commands in a single step to optimize database population performance. To this end, the sample uses the IFDPhysCommand interface to set an array of values for each parameter and the Execute method in Array DML mode to populate the database in a single step.Note: In this demo the “batch” and “Array DML” terms are interchangeable.

Location

You can find the Batch sample project at:

How to Use the Sample

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

Files

File in DelphiContains
IFDPhys_Batch.dproj
IFDPhys_Batch.dpr
The project itself.
fBatch.pas
fBatch.fmx
The main form.

Implementation

When you run the application, you see the following components on the form:

For more information and more external links for other samples, please go to the next link:

http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.IFDPhysCommand.Batch_Sample

Head over and check out the full source code for the Array DML bulk insert sample for Delphi.

Exit mobile version