tMap lookup issue

Highlighted
Five Stars

tMap lookup issue

Tables : 

Category_tbl : categoryid(Auto Generated), CategoryName, CategoryCode

Product_tbl :  productid(Auto Generated),categoryid,productname

 

Category XLS : CategoryCode,CategoryName

Product XLS : Product Name,CategoryCode

 

My Process 

Read Catgegory XLS -> Write Category TBL -> Read Product XLS -> JOIN tables using tMap(CategoryCode)  -> Get categoryId from Lookup tbl -> Write Product with CategoryId(Foreign Key)

 

I Can't get the CategoryId from Lookup db connection(category tbl) component


Accepted Solutions
Community Manager

Re: tMap lookup issue

The categoryid is generated by database rather than coming from Category XLS, so you need to query the categoryid after you insert the category information into database, try to change the job to
Read Catgegory XLS -> Write Category TBL
|onsubjobok
Read Product XLS -> JOIN tables using tMap(CategoryCode) -> lookup (select categoryid, CategoryCode from lookup_table)


----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: tMap lookup issue

Hi
Is it an inner join or left outer join on tMap? Can't get the categoryid even though the same CategoryCode exists in both tables? It might be an execution order issue, can you share a screenshot of the job?

Regards
Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business
Five Stars

Re: tMap lookup issue

 
Community Manager

Re: tMap lookup issue

The categoryid is generated by database rather than coming from Category XLS, so you need to query the categoryid after you insert the category information into database, try to change the job to
Read Catgegory XLS -> Write Category TBL
|onsubjobok
Read Product XLS -> JOIN tables using tMap(CategoryCode) -> lookup (select categoryid, CategoryCode from lookup_table)


----------------------------------------------------------
Talend | Data Agility for Modern Business
Five Stars

Re: tMap lookup issue

Hi shong, Thanks for your promptly response,

Write Category TBL is  tDBOutput(mySQL) component , Can't get onsubjobok event

Five Stars

Re: tMap lookup issue

Hi shong, Thanks for your support, It works now.

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