<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Checking for each row if the key exists in another table in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374861#M137396</link>
    <description>I think I see your problem :
&lt;BR /&gt;Instead of :
&lt;BR /&gt;
&lt;PRE&gt;tMysqlInput_20 --Iterate--&amp;gt; tMysqlInput_9&lt;/PRE&gt;
&lt;BR /&gt;Use :
&lt;BR /&gt;
&lt;PRE&gt;tMysqlInput_20 --row1--&amp;gt; tFlowToIterate --Iterate--&amp;gt; tMysqlInput_9&lt;/PRE&gt;
&lt;BR /&gt;On your tMysqlInput_9, you have :
&lt;BR /&gt;
&lt;PRE&gt;SELECT WHERE MONTH(currentMonth) == " + row20.currentMonth&lt;/PRE&gt;
&lt;BR /&gt;Try :
&lt;BR /&gt;
&lt;PRE&gt;SELECT WHERE MONTH(currentMonth) == " + ((String)globalMap.get("row1.code"))&lt;/PRE&gt;
&lt;BR /&gt;(with row1 being the flow name between tMysqlInput_20 and tFlowToIterate)
&lt;BR /&gt;
&lt;BR /&gt;The iterate link from tMysqlInput only increments a counter, and doesn't store retrieved datas.</description>
    <pubDate>Wed, 12 May 2010 15:13:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-05-12T15:13:27Z</dc:date>
    <item>
      <title>Checking for each row if the key exists in another table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374858#M137393</link>
      <description>Hi, 
&lt;BR /&gt;I have looked over the forum for and answer to this and couldn't find it so there it is : 
&lt;BR /&gt;Basically, from a result set, I'm gettint the number of distinct month involved then after that, I'm checking into another table for each different month found, if it exist. If so, I want to update the row and if now, insert it. 
&lt;BR /&gt;I tought my logic was good lookin at my schema but I guess not since each time, it inserts (and crash on duplicate key) the row and never updates it when it already exists. Beside, it actually seems to not iterate at all even If I used an iterate link. 
&lt;BR /&gt;I have put some screenshot of my component values for the part of the schema that buggs me. 
&lt;BR /&gt;Any help would be appreciated. 
&lt;BR /&gt;Thank you, 
&lt;BR /&gt; 
&lt;BR /&gt;(the first 4 pictures are not good, but deleting them doesn't seems to work)</description>
      <pubDate>Sat, 16 Nov 2024 13:26:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374858#M137393</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for each row if the key exists in another table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374859#M137394</link>
      <description>Hi 
&lt;BR /&gt;I didn't understand all of your problem, but maybe this can help : 
&lt;BR /&gt;- Try to use the tJoin component to get rejected (no month corresponding) or filtered rows. Then perform your operations for each flow ? 
&lt;BR /&gt;- Try to specify the "Update or insert" property of tMySQLInput ? 
&lt;BR /&gt;Hope that'll help. 
&lt;BR /&gt; 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Lie</description>
      <pubDate>Tue, 11 May 2010 09:36:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374859#M137394</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-11T09:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for each row if the key exists in another table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374860#M137395</link>
      <description>Hi Lie, 
&lt;BR /&gt;Thank you for your answer. 
&lt;BR /&gt;From what I can understand, the TJoin component is used to check a table against another one (a sql join) but what I'm trying to do is check for a value within a WHERE clause so I guess this is not a valid option for me. 
&lt;BR /&gt;For your second suggestion, I already used that property in my current schema but my problem is now before that point (I have already fixed a portion of it), when it is time to look up for the specified value within the table not on the action to take when found or not. 
&lt;BR /&gt;Maybe I wasn't clear enough on my first post so here is my detailled situation : 
&lt;BR /&gt;1) I'm running a query to get all the distinct month from a table column. 
&lt;BR /&gt;2) For each of these row, I want to run another query that will go check in another table if a row already exist with that specific month or not. 
&lt;BR /&gt;3) So far, the problem is that even if I have more than 1 different month (and thus, more than 1 row to iterate through), my "iterate" link doesn't seems to work. When looking at the flow, it seems that talend only iterate it once and not once for each row previously found (distinct month). 
&lt;BR /&gt; 
&lt;BR /&gt;Hope I made myself clearer. 
&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Wed, 12 May 2010 14:44:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374860#M137395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-12T14:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for each row if the key exists in another table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374861#M137396</link>
      <description>I think I see your problem :
&lt;BR /&gt;Instead of :
&lt;BR /&gt;
&lt;PRE&gt;tMysqlInput_20 --Iterate--&amp;gt; tMysqlInput_9&lt;/PRE&gt;
&lt;BR /&gt;Use :
&lt;BR /&gt;
&lt;PRE&gt;tMysqlInput_20 --row1--&amp;gt; tFlowToIterate --Iterate--&amp;gt; tMysqlInput_9&lt;/PRE&gt;
&lt;BR /&gt;On your tMysqlInput_9, you have :
&lt;BR /&gt;
&lt;PRE&gt;SELECT WHERE MONTH(currentMonth) == " + row20.currentMonth&lt;/PRE&gt;
&lt;BR /&gt;Try :
&lt;BR /&gt;
&lt;PRE&gt;SELECT WHERE MONTH(currentMonth) == " + ((String)globalMap.get("row1.code"))&lt;/PRE&gt;
&lt;BR /&gt;(with row1 being the flow name between tMysqlInput_20 and tFlowToIterate)
&lt;BR /&gt;
&lt;BR /&gt;The iterate link from tMysqlInput only increments a counter, and doesn't store retrieved datas.</description>
      <pubDate>Wed, 12 May 2010 15:13:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374861#M137396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-12T15:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for each row if the key exists in another table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374862#M137397</link>
      <description>OK, I see the big picture.&lt;BR /&gt;However, should I not be using the TMysqlRow component instead of my TMysqlInput_9 ?</description>
      <pubDate>Wed, 12 May 2010 16:36:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374862#M137397</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-12T16:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Checking for each row if the key exists in another table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374863#M137398</link>
      <description>Finally, I think I got it by adding a TForeach component between the TFlowIterate and the TMysqlInput component.&lt;BR /&gt;Thank you for the lead Lie.</description>
      <pubDate>Wed, 12 May 2010 18:13:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Checking-for-each-row-if-the-key-exists-in-another-table/m-p/2374863#M137398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-12T18:13:43Z</dc:date>
    </item>
  </channel>
</rss>

