tMysqlOutputBulkExec
Executes the Insert action in the specified MySQL or Aurora database.
As a dedicated component, tMysqlBulkExec improves performance when
performing Insert operations to a MySQL or Aurora database.
The tMysqlOutputBulk and
tMysqlBulkExec components are used together in a two step
process. In the first step, an output file is generated. In the second step, this file
is used in the INSERT statement used to feed a database. These two steps are fused
together in the tMysqlOutputBulkExec component.
tMysqlOutputBulkExec Standard properties
These properties are used to configure tMysqlOutputBulkExec running in the Standard Job framework.
The Standard
tMysqlOutputBulkExec component belongs to the Databases family.
The component in this framework is available in all Talend
products.
connector. The properties related to database settings vary depending on your database
type selection. For more information about dynamic database connectors, see Dynamic database components.
Basic settings
Database |
Select a type of database from the list and click |
Property type |
Either Built-in or |
 |
Built-in: No property data stored |
 |
Repository: Select the repository |
DB Version |
Select the version of the database that you are using. |
Host |
Database server IP address |
Port |
Listening port number of DB server. |
Database |
Name of the database |
Username and |
DB user authentication data. To enter the password, click the […] button next to the |
Action on table |
On the table defined, you can perform one of the following
None: No operation is carried
Drop and create table: The table is
Create table: The table does not
Create table if not exists: The
Drop table if exists and create:
Clear table: The table content is |
Table |
Name of the table to be written. Note:
Note that only one table can be written at a time and that the |
Local FileName |
Name of the file to be generated and loaded. This file is generated on the same machine where the Studio is |
Append |
Select the check box for this option to append new rows to the end |
Schema and Edit |
A schema is a row description, it defines the number of fields to Click Edit
|
 |
Built-In: You create and store the schema locally for this component |
 |
Repository: You have already created the schema and stored it in the When the schema to be reused has default values that are You can find more details about how to |
Advanced settings
Additional JDBC parameters |
Specify additional connection properties for the DB connection you Note:
You can press Ctrl+Space to |
Row separator |
String (ex: ” |
Field separator |
Character, string or regular expression to separate fields. |
Escape char |
Character of the row to be escaped |
Text enclosure |
Character used to enclose the text. |
Create directory if does not exist |
This check box is selected by default. It creates a directory to |
Custom the flush buffer size |
Customize the amount of memory used to temporarily store output |
Action on data |
On the data of the table defined, you can carry out the following
Insert records in table: Add new
Update records in table: Make
Replace records in table: Replace |
Records contain NULL value |
This check box is selected by default. It allows you to take |
Encoding |
Select the encoding from the list or select Custom and define it manually. This field is |
tStatCatcher Statistics |
Select this check box to collect the log data at the component |
Enable parallel execution |
Select this check box to perform high-speed data processing, by treating
multiple data flows simultaneously. Note that this feature depends on the database or the application ability to handle multiple inserts in parallel as well as the number of CPU affected. In the Number of parallel executions field, either:
|
Usage
Usage rule |
This component is mainly used when no particular transformation is |
Inserting data in bulk in MySQL database
This scenario describes a two-component Job which carries out the same
operation as the one described for tMysqlOutputBulk Standard properties
and tMysqlBulkExec Standard Properties, although no data is
transformed.
-
Drop a tRowGenerator and a
tMysqlOutputBulkExec component from
the Palette to the design workspace. -
Connect the components using a link such as Row > Main.
-
Set the tRowGenerator
parameters the same way as in Inserting transformed data in MySQL database. The schema is made of four columns including: ID, First Name, Last Name, Address and City. -
In the workspace, double-click the tMysqlOutputBulkExec to display the Component view and set the properties.
-
Define the database connection details in the corresponding
fields, if necessary. Consult the recommendations detailed in Inserting transformed data in MySQL database, concerning the conservation of connection details in the Repository, under the Metadata node. In the component view, select Repository in the Property Type field and then select the appropriate connection
in the adjacent field. The following fields will be filled in automatically.
For further information, see
Talend Studio
User Guide.
-
In the Action on table
field, select the None option as you want
to insert the data into a table which already exists. -
In the Table field, enter
the name of the table you want to populate, the name being clients in this example. -
In the Local filename
field, indicate the access path and the name of the file which contains the data
to be added to the table. In this example, the file is clients.txt. -
Click on the Advanced
settings tab to define the component’s advanced parameters.
-
In the Action on data
list, select the Insert records in table
to insert the new data in the table. -
Press F6 to run the
Job.
The result should be pretty much the same as in Inserting transformed data in MySQL database, but the data might differ as these are regenerated randomly everytime the Job is
run.