<?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: Tmysqlinput returns 2 rows instead of 1 in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Tmysqlinput-returns-2-rows-instead-of-1/m-p/2318982#M89276</link>
    <description>Hi,&lt;BR /&gt;Could you please attach a picture of your job.&lt;BR /&gt;Have you tried to run the query with the RptID manually to see how many results are returned?&lt;BR /&gt;The input String might also need to be changed to:&lt;BR /&gt;"SELECT * FROM HOLDxCONTROL WHERE ID IN('"+String.valueOf(context.RptID)+"')"&lt;BR /&gt;--- adding the apostrophe's&lt;BR /&gt;I want to see the layout of your job because I think you might have to use a tFlowtoIterate.&lt;BR /&gt;For example - &lt;BR /&gt;tFileInputPostitional --&amp;gt; tJavaRow -(Passing the RptID value as an output)-&amp;gt; tFlowToIterate - iterate -&amp;gt; tjava (Set the context eg. context.RptID = ((String)globalMap.get("row2.RptID")); -on Component ok-&amp;gt; tMySQLInput -&amp;gt; rest of your job&lt;BR /&gt;Regards,&lt;BR /&gt;Brandon</description>
    <pubDate>Wed, 16 Nov 2011 15:56:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-11-16T15:56:21Z</dc:date>
    <item>
      <title>Tmysqlinput returns 2 rows instead of 1</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmysqlinput-returns-2-rows-instead-of-1/m-p/2318981#M89275</link>
      <description>I have a file in a folder with a 17 character numeric name, the same name is stored in a MYSQL table as a primary key.
&lt;BR /&gt;As part of my workflow as there are 100's of these files I use a tfileinputpositional to read the header lines to see if the file is one I want to process.
&lt;BR /&gt;If the filter defines the file to be valid then I store the file name as a context variable i.e. 
&lt;BR /&gt;in tjavarow context.RptID = ((String)globalMap.get("tFileList_1_CURRENT_FILE"));
&lt;BR /&gt;as a test i then present the value of context.RptID in a message box thus a single value i.e. 15982000216817701
&lt;BR /&gt;the process then uses a Tmysqlinput with the selection string as "SELECT * FROM HOLDxCONTROL WHERE ID IN("+String.valueOf(context.RptID)+")";
&lt;BR /&gt;for testing i use a Tjavarow to show the expected results however 2 rows are returned ?.
&lt;BR /&gt;15982000216817700|CRF.GLSHORT|GB0010002|03-10-2011|01-01-1970|Y|201110031806|03-10-2011
&lt;BR /&gt;15982000216817701|CRF.MBGL|GB0010002|03-10-2011|01-01-1970|Y|201110031806|03-10-2011
&lt;BR /&gt;looking at the run-stats the filtre to tjavarow shows 1 row returned as does the tjavarow to tmsgbox.
&lt;BR /&gt;the tmsgbox is connected to tmysqlinput with on component ok which works but the stat of course from tmysqlinput shows 2 rows returned.
&lt;BR /&gt;Does anybody know why this has occured and how to solve the problem please.</description>
      <pubDate>Sat, 16 Nov 2024 12:34:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmysqlinput-returns-2-rows-instead-of-1/m-p/2318981#M89275</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Tmysqlinput returns 2 rows instead of 1</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmysqlinput-returns-2-rows-instead-of-1/m-p/2318982#M89276</link>
      <description>Hi,&lt;BR /&gt;Could you please attach a picture of your job.&lt;BR /&gt;Have you tried to run the query with the RptID manually to see how many results are returned?&lt;BR /&gt;The input String might also need to be changed to:&lt;BR /&gt;"SELECT * FROM HOLDxCONTROL WHERE ID IN('"+String.valueOf(context.RptID)+"')"&lt;BR /&gt;--- adding the apostrophe's&lt;BR /&gt;I want to see the layout of your job because I think you might have to use a tFlowtoIterate.&lt;BR /&gt;For example - &lt;BR /&gt;tFileInputPostitional --&amp;gt; tJavaRow -(Passing the RptID value as an output)-&amp;gt; tFlowToIterate - iterate -&amp;gt; tjava (Set the context eg. context.RptID = ((String)globalMap.get("row2.RptID")); -on Component ok-&amp;gt; tMySQLInput -&amp;gt; rest of your job&lt;BR /&gt;Regards,&lt;BR /&gt;Brandon</description>
      <pubDate>Wed, 16 Nov 2011 15:56:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmysqlinput-returns-2-rows-instead-of-1/m-p/2318982#M89276</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-16T15:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Tmysqlinput returns 2 rows instead of 1</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmysqlinput-returns-2-rows-instead-of-1/m-p/2318983#M89277</link>
      <description>The reason I use the Tfileinputpositional is to read in line by line the contents of the txt file.  The filter allows me to identify from the report code if it is a file i want to use,  note this code is not the same as the name of the file. &lt;BR /&gt;This is clearly shown in the statistics where the row count from the text file is anything between 1 and 10 depending on which line my filter finds the information I want then you can see only one row is used on the subsequent tjavarow etc.  however as you see at the end tmysqlinput returns 2 rows one being the primary key before my required primary key.</description>
      <pubDate>Thu, 17 Nov 2011 10:40:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmysqlinput-returns-2-rows-instead-of-1/m-p/2318983#M89277</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-17T10:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Tmysqlinput returns 2 rows instead of 1</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmysqlinput-returns-2-rows-instead-of-1/m-p/2318984#M89278</link>
      <description>I have solved the error by putting the extra single '  in the select string.  not sure why it would have cause the problem in the first place but now the process works.  Many thanks for the help on this.</description>
      <pubDate>Thu, 17 Nov 2011 10:51:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmysqlinput-returns-2-rows-instead-of-1/m-p/2318984#M89278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-17T10:51:19Z</dc:date>
    </item>
  </channel>
</rss>

