<?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: Do if-else based on row count in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Do-if-else-based-on-row-count/m-p/2267460#M46327</link>
    <description>Assume you are using SQL SERVER, you'll get the row count of the tMSSqlInput using the global variable tMSSqlInput_1.NB_LINE (just replace the component number according to jours). You can use this variable where you want using the following syntax: (Integer)globalVar.get("tMSSqlInput_1.NB_LINE")
&lt;BR /&gt;Hope this helps.</description>
    <pubDate>Wed, 10 May 2017 22:24:07 GMT</pubDate>
    <dc:creator>TRF</dc:creator>
    <dc:date>2017-05-10T22:24:07Z</dc:date>
    <item>
      <title>Do if-else based on row count</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Do-if-else-based-on-row-count/m-p/2267459#M46326</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering, when I do a SQL query, how can I configure an different outcome based on the resulting row count?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;In other words, return different status codes (using the tRESTresponse) based on the query outcome (rows returned vs. none).&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Br,&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 09:48:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Do-if-else-based-on-row-count/m-p/2267459#M46326</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T09:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Do if-else based on row count</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Do-if-else-based-on-row-count/m-p/2267460#M46327</link>
      <description>Assume you are using SQL SERVER, you'll get the row count of the tMSSqlInput using the global variable tMSSqlInput_1.NB_LINE (just replace the component number according to jours). You can use this variable where you want using the following syntax: (Integer)globalVar.get("tMSSqlInput_1.NB_LINE")
&lt;BR /&gt;Hope this helps.</description>
      <pubDate>Wed, 10 May 2017 22:24:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Do-if-else-based-on-row-count/m-p/2267460#M46327</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-05-10T22:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Do if-else based on row count</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Do-if-else-based-on-row-count/m-p/2267461#M46328</link>
      <description>&lt;P&gt;NB_LINE may be not very effective if number of rows big - before return number of rows Talend will receive all data from server&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I prefer use SQL construction tMSSQLRow, like&lt;/P&gt;
&lt;PRE&gt;SELECT CASE WHEN EXISTS (SELECT id FROM t1) THEN 1 ELSE 0 END AS check_result&lt;/PRE&gt;
&lt;P&gt;return 1/0&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;SELECT CASE WHEN EXISTS (SELECT id FROM t1) THEN (SELECT count(*) as cnt FROM t1) ELSE 0 END AS cnt&lt;/PRE&gt;
&lt;P&gt;return number of rows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 23:50:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Do-if-else-based-on-row-count/m-p/2267461#M46328</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2017-05-10T23:50:43Z</dc:date>
    </item>
  </channel>
</rss>

