Scenario: 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 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.