Configuring the components - 7.3

MySQL

Version
7.3
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > Database components (Integration) > MySQL components
Data Quality and Preparation > Third-party systems > Database components (Integration) > MySQL components
Design and Development > Third-party systems > Database components (Integration) > MySQL components
Last publication date
2024-02-21

Procedure

  1. Double-click tFixedFlowInput to open its Basic settings view.
  2. Select Use Inline Content (delimited file) in the Mode area.
    In the Content field, enter the data to be transferred:
    1;30
    2;20
  3. Double-click the [...] button next to Edit schema to open the schema editor.
    Click the [+] button to add two columns, namely id and age, with the type of Integer.
    Click Ok to close the editor.
  4. Double-click tMysqlRow to open its Basic settings view.
  5. In the Host and Port fields, enter the connection details.
    In the Database field, enter the database name.
    In the Username and Password fields, enter the authentication details.
    In the Query field, enter the SQL query to retrieve the id and name data from the Mysql table employee: "select id, name from employee WHERE id=?".
    The question mark, "?", represents the parameter to be set in the Advanced settings tab.
  6. Click the [...] button next to Edit schema to open the schema editor.
  7. Click the [+] button to add two columns in the right part, namely recordset and age, with the type of Object and Integer. Note that recordset is intended to hold the query results of the Mysql table, namely the id and name fields.
    Click OK to close the editor.
  8. Click the Advanced settings tab for further setup.
  9. Select the Propagate QUERY's recordset check box and choose recordset from the use column list to insert the query results in that column.
    Select the Use PreparedStatement check box and define the parameter used in the query in the Set PreparedStatement Parameters table.
  10. Click on the [+] button to add a line.
    In the Parameter Index cell, enter the parameter position in the SQL instruction. Enter "1" as we are only using one parameter in this example.
    In the Parameter Type cell, enter the type of parameter. Here, the parameter is an integer. Hence, select Int from the list.
    In the Parameter Value cell, enter the parameter value. Here, we want to retrieve the id and name from the employee table based on the id value from the source flow. Hence, enter row3.id.
  11. Double-click tParseRecordSet to open its Basic settings view.
    From the Prev. Comp. Column list, select the column to parse, namely recordset.
  12. Click the [...] button next to Edit schema to open the schema editor.
    Click the [+] button to add three columns in the right part, namely id, name and age, with the type of Integer, String and Integer. Note that the id and name fields are intended to hold the parsed data of recordset.
    Click OK to close the editor.
    In the Attribute table, in the Value fields which correspond to id and name, enter the name of the column in the Mysql table to be retrieved, namely "id" and "name".
  13. Double-click tLogRow to open its Basic settings view.
    In the Mode area, select Table (print values in cells of a table for better display.