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.
Drop a tCreateTable component from the Databases family in the Palette to the design workspace.
In the Basic settings view, and from the Database Type list, select Mysql for this scenario.
From the Table Action list, select Create table.
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.
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.
In the Table Name field, fill in a name for the table to be created.
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.
In any case (Built-in or Repository) click Edit Schema to check the data type mappingClick Edit Schema to define the data structure.
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.
Save your Job and press F6 to execute it.
The table is created empty but with all columns defined in the Schema.