[resolved] Can we write query in tmap?

One Star

[resolved] Can we write query in tmap?

Hi,
Can we write query in tmap?
Actually my problem is something like this,
During transformation in tMap component, I want to check whether data already exists or not? If it exist than I would like to change it with some additional information.
For example,
if XYZ-WERB is already exist in SKU column than I would like to add some number at the end of SKU so I can eliminate duplication from SKU column.
For more information consider attached snapshot of my tmap component. So can we write query in "Expression" to check whether data is already exists or not in column?
Thanks.

Accepted Solutions
Community Manager

Re: [resolved] Can we write query in tmap?

Hi
No, you can't execute a query on tMap, you need to use A db input component to select all existing records, and do a inner join with source records, get the matched records, that are already existing records in database.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: [resolved] Can we write query in tmap?

Hi
No, you can't execute a query on tMap, you need to use A db input component to select all existing records, and do a inner join with source records, get the matched records, that are already existing records in database.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Can we write query in tmap?

Hi,
Thanks for reply shong. I got what you want to say. DB input is the last and most reliable way. But is there any other way to check whether data already exists while transforming data through tmap? so I don't have to recalculate my all data.
Thanks.
Six Stars

Re: [resolved] Can we write query in tmap?

Check other answers in the forum, that suggest the use of hashmaps...