Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I need to fetch all users and the list of their orders (linked by a user_id field )
so the first tDBInput returns the users , but then how do I tell the second tDBInput the current user ID (..where user_id= some variable) ?
how can I set variables/parameters to a sub query ? do I have to use sub Jobs ? iteration links ?
can someone tell me how this is done ?
regards
Hi,
The most robust way is to store the user ids to a temporary table and use inner join in second tDBInput to get only needed user ids. You can store the user ids to a context string variable and replace them in the IN clause of the query. But this approach is not scalable especially when the number of user ids go beyond 1000 in IN clause.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
actualy I did it with tFlowToIterate component
Hi Phil,
You can follow that method also. But the only flip side with that approach is that you will be processing one record at a time in iterative fashion. So please do a performance test of the flow before moving it to production. If there are throughput issues, please create the flow as per my earlier post.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂