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

Learn How To Execute Batch Queries With This Array DML For FireDAC In Delphi

The Batch sample shows you how to use Array DML to execute multiple SQL INSERT commands in a single step to optimize database population performance. 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 Batch.dproj.
  2. Press F9 or choose Run > Run.

Files

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

Implementation

Before running the sample, the main components are configured at design time using the Object Inspector as follows:

Note: You can change the SQL property of qryInsert at run time by checking the insert blob checkbox.

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

To define a connection to a database, click on the Use Connection Definition combo box and select an option. When you select an item of the combo box, the sample enables the ExecSQL and Disconnect buttons and unchecks the insert blob check box. Then, if you click on the ExecSQL button, the sample executes the SQL statement of qryBatch. The execution of the SQL statement varies depending on the state of the check boxes and the value of the Arraysize value:

If you want to visit the original post, please follow the link below:

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

Exit mobile version