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
3 REPLIES
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