<?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: Running a MERGE (SQL) in TALEND in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Running-a-MERGE-SQL-in-TALEND/m-p/2318936#M89232</link>
    <description>&lt;P&gt;Hello stephbzr,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as I understand the SQL merge statement, the select after "using" (i.e. the table TMP) is your input data (for a tMap component). The table TMPD is the lookup table and also the output/target.&lt;/P&gt;&lt;P&gt;The "on" condition (TMPD.ID_TRT_MUTIX_PARAM = TMP.ID_TRT_MUTIX_PARAM) is the join between the input and lookup table. As your merge statement only has an "on matched" clause, the join model in the tMap is set to "inner join". (We can discard non-matching rows.)&lt;/P&gt;&lt;P&gt;Please find the uploaded screenshot for a detailed outline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "Update_Flag" is the expression&lt;/P&gt;&lt;P&gt;TMP.TRT_MUTIX_PARAM_CODE.equals("NB_LIGNES_FIC") || TMP.TRT_MUTIX_PARAM_CODE.equals("TAILLE_FIC") || TMP.TRT_MUTIX_PARAM_CODE.equals("ID_HIST")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and "Update_Value" is&lt;/P&gt;&lt;P&gt;TMP.TRT_MUTIX_PARAM_CODE.equals("NB_LIGNES_FIC") ? 1000 : TMP.TRT_MUTIX_PARAM_CODE.equals("TAILLE_FIC") ? 2000 : TMP.TRT_MUTIX_PARAM_CODE.equals("ID_HIST") ? 3000 : 0&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An update to the zero value can not occur because of the use of the Update_Flag as a filter on the output side.&lt;/P&gt;&lt;P&gt;The tMap output then connects to your DBOutput component using "update" as the "action on data" setting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000UykniAAB.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134860i938244BCD353FB3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000UykniAAB.jpg" alt="0695b00000UykniAAB.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Sep 2022 17:32:27 GMT</pubDate>
    <dc:creator>ThWabi</dc:creator>
    <dc:date>2022-09-07T17:32:27Z</dc:date>
    <item>
      <title>Running a MERGE (SQL) in TALEND</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Running-a-MERGE-SQL-in-TALEND/m-p/2318933#M89229</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a SQL query with MERGE that allows me to UPDATE several rows at once in my database (with a join).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000UxWpiAAF.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157814i66C9AEF978DB78E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000UxWpiAAF.png" alt="0695b00000UxWpiAAF.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to translate this idea into TALEND, but I have no idea how I'm going to do it. The data from ID_TRTM and the data after each "THEN", my TALEND job has them (these are statistics about a file such as number of rows, size, etc..).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any ideas ? Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 22:37:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Running-a-MERGE-SQL-in-TALEND/m-p/2318933#M89229</guid>
      <dc:creator>stephbzr</dc:creator>
      <dc:date>2024-11-15T22:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running a MERGE (SQL) in TALEND</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Running-a-MERGE-SQL-in-TALEND/m-p/2318934#M89230</link>
      <description>&lt;P&gt;Hi @Stéphane Barbezier​&amp;nbsp;you can run this query in talend with tDBRow component  &lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 11:19:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Running-a-MERGE-SQL-in-TALEND/m-p/2318934#M89230</guid>
      <dc:creator>Jmiles1658991691</dc:creator>
      <dc:date>2022-08-25T11:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Running a MERGE (SQL) in TALEND</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Running-a-MERGE-SQL-in-TALEND/m-p/2318935#M89231</link>
      <description>&lt;P&gt;Thank you very much @Juanita miles​&amp;nbsp;, I learned what this component does and it works very well for what I am looking for. &lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2022 12:37:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Running-a-MERGE-SQL-in-TALEND/m-p/2318935#M89231</guid>
      <dc:creator>stephbzr</dc:creator>
      <dc:date>2022-08-28T12:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Running a MERGE (SQL) in TALEND</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Running-a-MERGE-SQL-in-TALEND/m-p/2318936#M89232</link>
      <description>&lt;P&gt;Hello stephbzr,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as I understand the SQL merge statement, the select after "using" (i.e. the table TMP) is your input data (for a tMap component). The table TMPD is the lookup table and also the output/target.&lt;/P&gt;&lt;P&gt;The "on" condition (TMPD.ID_TRT_MUTIX_PARAM = TMP.ID_TRT_MUTIX_PARAM) is the join between the input and lookup table. As your merge statement only has an "on matched" clause, the join model in the tMap is set to "inner join". (We can discard non-matching rows.)&lt;/P&gt;&lt;P&gt;Please find the uploaded screenshot for a detailed outline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "Update_Flag" is the expression&lt;/P&gt;&lt;P&gt;TMP.TRT_MUTIX_PARAM_CODE.equals("NB_LIGNES_FIC") || TMP.TRT_MUTIX_PARAM_CODE.equals("TAILLE_FIC") || TMP.TRT_MUTIX_PARAM_CODE.equals("ID_HIST")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and "Update_Value" is&lt;/P&gt;&lt;P&gt;TMP.TRT_MUTIX_PARAM_CODE.equals("NB_LIGNES_FIC") ? 1000 : TMP.TRT_MUTIX_PARAM_CODE.equals("TAILLE_FIC") ? 2000 : TMP.TRT_MUTIX_PARAM_CODE.equals("ID_HIST") ? 3000 : 0&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An update to the zero value can not occur because of the use of the Update_Flag as a filter on the output side.&lt;/P&gt;&lt;P&gt;The tMap output then connects to your DBOutput component using "update" as the "action on data" setting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000UykniAAB.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134860i938244BCD353FB3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000UykniAAB.jpg" alt="0695b00000UykniAAB.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 17:32:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Running-a-MERGE-SQL-in-TALEND/m-p/2318936#M89232</guid>
      <dc:creator>ThWabi</dc:creator>
      <dc:date>2022-09-07T17:32:27Z</dc:date>
    </item>
  </channel>
</rss>

