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.
Component family |
Databases/MySQL |
|
Function |
Executes the Insert action on the data provided. |
|
Purpose |
As a dedicated component, it improves performance during Insert |
|
Basic settings |
Property type |
Either Built-in or Since version 5.6, both the Built-In mode and the Repository mode are |
|
|
Built-in: No property data stored |
|
|
Repository: Select the repository |
|
DB Version |
Select the version of MySQL 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 |
Warning
tCreateTable can be used as a substitute for |
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. NoteNote 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 Since version 5.6, both the Built-In mode and the Repository mode are Click Edit schema to make changes to the schema. If the
|
|
|
Built-In: You create and store the schema locally for this |
|
|
Repository: You have already created the schema and When the schema to be reused has default values that are integers or functions, ensure that For more details, see https://help.talend.com/display/KB/Verifying+default+values+in+a+retrieved+schema. |
Advanced settings |
Additional JDBC parameters |
Specify additional connection properties for the DB connection you NoteYou 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
Warning
|
Usage |
This component is mainly used when no particular transformation is |
|
Limitation |
n/a |
This scenario describes a two-component Job which carries out the same operation as
the one described for tMysqlOutputBulk properties and tMysqlBulkExec 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 Scenario: 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 Scenario: 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 Scenario: Inserting transformed data in MySQL database, but the
data might differ as these are regenerated randomly everytime the Job is run.