BulkImport
Last updated
Last updated
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 function to add the rows that you want to insert. See the below.
The that specifies how to connect to the database.
The timeout value in seconds. 0 indicates the bulk copy operation will wait indefinitely.
The name of the destination table.
Click on the ... icon to open the Editor.
Destination Table Properties
Connection string
The that specifies how to connect to the database.
Table
Select the relevant table to copy to.
Columns
Indicate which columns to copy to.
The number of rows to collect in a transaction before it is committed to the server.
Steps:
From the PostgreSQL plugin, drag the BulkImport function onto the design canvas.
Set the BulkImport properties (see above for details).
From the File plugin, drag the TextFileRead function onto the design canvas (nested below your BulkImport function).
Set the TextFileRead properties to read each row from the source file for the destination database, defining the fields to assist with target mapping.
Drag the SetValue function from the Linx plugin onto the design canvas, nested below the TextFileRead function.
Set the Target property of the SetValue function to BulkImport.Import.Write
.
Then click the Set Fields editor button next to the Source property to assign the values to the table's columns.
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 function.