BulkImport

BulkImport efficiently copies a large number of rows into a PostgreSQL database table.

This function creates an Import object in its execution path. Use the SetValue function to add the rows that you want to insert. See the example below.


Properties

Connection string

The connection string that specifies how to connect to the database.

Timeout

The timeout value in seconds. 0 indicates the bulk copy operation will wait indefinitely.

Table

The name of the destination table.

Click on the ... icon to open the Editor.

Destination Table Properties

Connection string

The connection string that specifies how to connect to the database.

Table

Select the relevant table to copy to.

Columns

Indicate which columns to copy to.


Batch size

The number of rows to collect in a transaction before it is committed to the server.


Example

Suppose you have a CSV file with many records to load into a database table. Using the BulkImport function, as shown below, runs significantly faster than using the more generic ExecuteSQL function.

Steps:

  1. From the PostgreSQL plugin, drag the BulkImport function onto the design canvas.

  2. Set the BulkImport properties (see above for details).

  3. From the File plugin, drag the TextFileRead function onto the design canvas (nested below your BulkImport function).

  4. Set the TextFileRead properties to read each row from the source file for the destination database, defining the fields to assist with target mapping.

  5. Drag the SetValue function from the Linx plugin onto the design canvas, nested below the TextFileRead function.

    Bulk Import Example
  6. Set the Target property of the SetValue function to BulkImport.Import.Write.

Bulk Import Example
  1. Then click the Set Fields editor button next to the Source property to assign the values to the table's columns.

    Bulk Import Example

Last updated