change column name

Four Stars

change column name

Hi,
how can I change column names.
I try to read a MSSQL table and change from db column names to schema names and write them with these new names into a MSSQLOutput.
I found out that I can change the names at the MSSQLOutput component but this is not realy nice, if i want to create mutliple outputs from one source.
In this case I have to this for each output.
Hope there is a easier way...
so long
Martin
Talend Open Studio 3.0.0.r18993 Java
Community Manager

Re: change column name

Hello
I try to read a MSSQL table and change from db column names to schema names and write them with these new names into a MSSQLOutput.

The db column names must be the same as the real column names in your DB tables.
I found out that I can change the names at the MSSQLOutput component but this is not realy nice, if i want to create mutliple outputs from one source.

Yes, the tReplicate component can fit your need. You can create multiple outputs from one source with it, for example:
tMSSQLInput--tReplicate--tMSSQLOutput
|
tLogRow
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Four Stars

Re: change column name

Hello,
thank you shong.
I'm a bit irritated.
I can't understand, why the column names must be the same as the real DB names.
If I do some calculation on the field, or generate a new field, I'm also able to change the name.
In any other ETL tool I testet, it was possible to change column names, as first step of a etl process.
I can't belive that there is no way in talend.
:-\
best regards
Martin
Employee

Re: change column name

You can use the column label you want in your whole job.
You just have to map your own column label to the real db label somewhere....
This can be done in a tMap just before the tYourDBOutput or within the tYourDBOutput component with the Advanced Setting / Use Field option (but as it's not graphical it 's much more complicate than using an intermediate tMap...)
Hth,
Four Stars

Re: change column name

Hi,
thank you mhirt.
this works fine and solves my problem!
tnx
Martin
One Star

Re: change column name

Hi,
Using a source file we created a job and got the output. Next time when the updated source file comes with following updations:
1. with an extra column
2. names of 2 columns are different.

Can we use the same Job again using the same schema so that extra column is updated dynamically and no impact with 2 differing column names.
as it's an irritating and monotonous task to create the same job again.
Can any 1 help
Thanks in advance,
Anchit
One Star

Re: change column name

Hi,
Using a source file we created a job and got the output. Next time when the updated source file comes with following updations:
1. with an extra column
2. names of 2 columns are different.

Can we use the same Job again using the same schema so that extra column is updated dynamically and no impact with 2 differing column names.
as it's an irritating and monotonous task to create the same job again.
Can any 1 help
Thanks in advance,
Anchit
One Star

Re: change column name

Hello,
how can i change my column names in the output file(tlogrow).
Five Stars

Re: change column name

If all you want to do is to simply change field names within your Job, use a tMap component so that you can map from one schema to another.