Dynamic Addition of column

One Star

Dynamic Addition of column

Hi,
I want to dynamically add or delete column in mysql table using CSV file. I am not able to insert or update the mysql table using 'Create New table if not exist option' as i want to use the same table (instead of dropping the table and cerating it). I want the new data to come after the older one in mysql table with updated fields.like (id and name) other (id, name and region) in the same table with respective values
One Star

Re: Dynamic Addition of column

Hi
tMysqlOutput cannot change the structure of DB table if the table has been created.
The workaround is to drag and drop tMysqlRow as a subjob to add or delete columns.
"alter table name add  column Columnname varchar(10); "

Regards,
Pedro
One Star

Re: Dynamic Addition of column

Hi,
thnx...Actually i am taking Dynamic data type. Here i need to define the column name statically. IS there some other way round? using dynamic data type
One Star

Re: Dynamic Addition of column

Hi
Actually I understand your requirement. But it's hard to do this sheer dynamically, though there is dynamic schema feature.
Because the only way in which we can add or delete columns is tMysqlRow if you don't want to drop table.
You have to edit query of tMysqlRow manually.
Usually people will not change the structure of one table after it has been created, when building up data warehouse or some projects like that.
Regards,
Pedro

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog