<?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: if query returns a recordset, do this, otherwise do that in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/if-query-returns-a-recordset-do-this-otherwise-do-that/m-p/2356414#M121940</link>
    <description>thank you very much, @shong, that was exactly the help i needed. apparently, my profile is still unable to post images and such, so here's a link to a screenshot of the finished job. 
&lt;BR /&gt;screenshots: 
&lt;BR /&gt; 
&lt;A href="http://imgur.com/a/f17PA#0" rel="nofollow noopener noreferrer"&gt;http://imgur.com/a/f17PA#0&lt;/A&gt;</description>
    <pubDate>Tue, 03 Jan 2012 16:53:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-01-03T16:53:00Z</dc:date>
    <item>
      <title>if query returns a recordset, do this, otherwise do that</title>
      <link>https://community.qlik.com/t5/Talend-Studio/if-query-returns-a-recordset-do-this-otherwise-do-that/m-p/2356411#M121937</link>
      <description>hey all, need a lil help on a fairly simple task. here's the scenario: 
&lt;BR /&gt;i have two tables, ListAddress and RepListResult. i need to pull all records from ListAddress, which I will then iterate over. for each returned row from ListAddress, i need to run a query that uses the ListAddress row's 'AddressId' column; this query will return any record from RepListResult that has a matching 'AddressId'. 
&lt;BR /&gt;so, all of that above i have been abel to do, but here's where i'm stuck now: if the cross-check query returns even one row (i.e. its recordset is not null nor empty), i do not want to do anything at all. if there are no rows returned, i want to then take the original row's data from the first ListAddress query and write it to a CSV file. 
&lt;BR /&gt;i've attached a screenshot of my job thus far, but would greatly appreciate any input on how i can accomplish the end of the job. also, any links to documentation on how to use components, particularly examples, are very welcome. thanks guys!</description>
      <pubDate>Sat, 16 Nov 2024 12:29:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/if-query-returns-a-recordset-do-this-otherwise-do-that/m-p/2356411#M121937</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: if query returns a recordset, do this, otherwise do that</title>
      <link>https://community.qlik.com/t5/Talend-Studio/if-query-returns-a-recordset-do-this-otherwise-do-that/m-p/2356412#M121938</link>
      <description>i don't know where the image went, but her's a link to it: &lt;A href="http://i.imgur.com/8cZdl.png" rel="nofollow noopener noreferrer"&gt;http://i.imgur.com/8cZdl.png&lt;/A&gt;</description>
      <pubDate>Fri, 30 Dec 2011 19:37:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/if-query-returns-a-recordset-do-this-otherwise-do-that/m-p/2356412#M121938</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-30T19:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: if query returns a recordset, do this, otherwise do that</title>
      <link>https://community.qlik.com/t5/Talend-Studio/if-query-returns-a-recordset-do-this-otherwise-do-that/m-p/2356413#M121939</link>
      <description>Hi 
&lt;BR /&gt;Which database type? Mysql? Oracle? or others? 
&lt;BR /&gt;There is a global variable like ((Integer)globalMap.get("tMysqlInput_2_NB_LINE")), we use normally this global variable to check how many lines are returned by the query. For example: 
&lt;BR /&gt;tMysqlInput_1--row1--&amp;gt;tFlowToIterate----&amp;gt;iterate--&amp;gt;tMysqlInput_2---&amp;gt;tLogRow---runIf---tFixedFlowInput--main--tFileOutputDelimited 
&lt;BR /&gt;on tMysqlInput_1: 
&lt;BR /&gt;select AddressId from ListAddress 
&lt;BR /&gt;on tMysqlInput_2: 
&lt;BR /&gt;run a query that uses the ListAddress row's 'AddressId' column as you mentioned. 
&lt;BR /&gt;Set the condition of RunIf: 
&lt;BR /&gt;((Integer)globalMap.get("tMysqlInput_2_NB_LINE"))==0 
&lt;BR /&gt;on tFixedFowInput, generate one line with one column on the schema, 
&lt;BR /&gt;key:value 
&lt;BR /&gt;AddressId 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;Integer)globalMap.get("row1. AddressId") 
&lt;BR /&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Sat, 31 Dec 2011 02:10:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/if-query-returns-a-recordset-do-this-otherwise-do-that/m-p/2356413#M121939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-31T02:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: if query returns a recordset, do this, otherwise do that</title>
      <link>https://community.qlik.com/t5/Talend-Studio/if-query-returns-a-recordset-do-this-otherwise-do-that/m-p/2356414#M121940</link>
      <description>thank you very much, @shong, that was exactly the help i needed. apparently, my profile is still unable to post images and such, so here's a link to a screenshot of the finished job. 
&lt;BR /&gt;screenshots: 
&lt;BR /&gt; 
&lt;A href="http://imgur.com/a/f17PA#0" rel="nofollow noopener noreferrer"&gt;http://imgur.com/a/f17PA#0&lt;/A&gt;</description>
      <pubDate>Tue, 03 Jan 2012 16:53:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/if-query-returns-a-recordset-do-this-otherwise-do-that/m-p/2356414#M121940</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-03T16:53:00Z</dc:date>
    </item>
  </channel>
</rss>

