Talend Create Table

Talend tCreateTable component is useful to create a table in a database. We can use this Talend tCreateTable to create a table before loading the output into the database.

In this Talend example, we create a job that loads data into this newly created SQL Server table.

Talend Create Database Table Example

Drag and drop the Talend tCreateTable from palette to job designer.

Talend Create Table 1

From the below screenshot, you can see by default it is pointing to the MySQL database. This Talend Component tab has all the properties required to connect with the MySQL database and create a table.

Talend Create Table 2

Let me select the MS SQL Server as the Database type.

Talend Create Table 3

Now, you can see the options to connect with SQL Server.

Talend Create Table 4

We just copied the tFilterRow job and pasted all the components into this job. I suggest you refer to Talend tFilterRow article in Talend.

Talend Create Table 5

Next, we removed the OnSubjectOk trigger, and pointed it to tCreateTable and connected the Main row of tCreateTable with tDBInput. It means that once the connection established to the database, it will reach the tCreateTable, and then go to the tDBInput.

Talend Create Table 6

Within the Talend tCreateTable Component tab, we use the existing connection and then create a table name a1234. Here, the table action options are the same as the tDBOutput. So, please refer to Load data from the text file to the database article. We are selecting the Drop table if it exists and create, which means it will drop the table if a1234 exists; otherwise, it creates a1234 table.

Talend Create Table 7

Please click on the Edit Schema button to create a schema or column name for the table you want to create. As you can see from the below, we create a schema that matches the Customer table that we selected in the tDBInput.

Talend Create Table 8

Within the tDBOutput, we changed the table name as a1234, and Action on the table as Truncate Table.

Talend Create Table 9

Let me run this Talend Create database table job.

Talend Create Table 10

From the below Management Studio screenshot, our job has created the table and stored the filtered data inside it. Within the SQL table properties, you can check the created date and time also.

Talend Create Table 11