Scenario: Creating new table in a Mysql Database - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

The Job described below aims at creating a table in a database, made of a dummy schema taken from a delimited file schema stored in the Repository. This Job is composed of a single component.

  1. Drop a tCreateTable component from the Databases family in the Palette to the design workspace.

  2. In the Basic settings view, and from the Database Type list, select Mysql for this scenario.

  3. From the Table Action list, select Create table.

  4. Select the Use Existing Connection check box only if you are using a dedicated DB connection component tMysqlConnection. In this example, we won't use this option.

  5. In the Property type field, select Repository so that the connection fields that follow are automatically filled in. If you have not defined your DB connection metadata in the DB connection directory under the Metadata node, fill in the details manually as Built-in.

  6. In the Table Name field, fill in a name for the table to be created.

  7. If you want to retrieve the Schema from the Metadata (it doesn't need to be a DB connection Schema metadata), select Repository then the relevant entry.

  8. In any case (Built-in or Repository) click Edit Schema to check the data type mappingClick Edit Schema to define the data structure.

  9. Click the Reset DB Types button in case the DB type column is empty or shows discrepancies (marked in orange). This allows you to map any data type to the relevant DB data type. Then, click OK to validate your changes and close the dialog box.

  10. Save your Job and press F6 to execute it.

The table is created empty but with all columns defined in the Schema.