<?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: Result Query to context variable in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Result-Query-to-context-variable/m-p/2341667#M109599</link>
    <description>&lt;BLOCKQUOTE&gt;
  JoRoesecke wrote: 
 &lt;BR /&gt;No need to use a context for this. You can achieve this by using e.g. tOracleInput/tMySqlInput/... --&amp;gt; tFlowToIterate --&amp;gt; tOracleInput/tMySqlInput/... --&amp;gt; (everything else you want to do). The first input represents your query posted above (select max(a) from table).&amp;nbsp; 
 &lt;BR /&gt;In tFlowToIterate you convert the input into a global variable which you can use in your next input like this:&amp;nbsp; 
 &lt;BR /&gt;"select XYZ from TABLE2 WHERE COLUMN = " + ((String)globalMap.get("a"))&amp;nbsp; 
 &lt;BR /&gt;(assuming that you named the column "a" in the schema of the first input and that it is of a numeric type). 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Hi Jo...thank you so much to your suggest. It's very simple.&amp;nbsp; 
&lt;BR /&gt;My job going execute fine, but no rows insert in my 2nd table: 
&lt;BR /&gt;I would compare the column_date to select new elements from 2nd table and insert/update in first table. 
&lt;BR /&gt;I would : select max(date) as a from table1-&amp;gt;result in variable-&amp;gt; "select * from table2 where column_date &amp;gt;"+((String)globalMap.get("a")) 
&lt;BR /&gt;I think that is not string. Exist ((Date)globalmap.get("a")) ?&amp;nbsp; 
&lt;BR /&gt;How I can do it? 
&lt;BR /&gt; 
&lt;BR /&gt;Thank so much 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MFjR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154064iB5A83533C2E51DA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MFjR.png" alt="0683p000009MFjR.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Mon, 19 Sep 2016 10:55:01 GMT</pubDate>
    <dc:creator>chichibio</dc:creator>
    <dc:date>2016-09-19T10:55:01Z</dc:date>
    <item>
      <title>Result Query to context variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Result-Query-to-context-variable/m-p/2341665#M109597</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I'would store the result of query in variable and use this variable in new query.&lt;BR /&gt;For example:&lt;BR /&gt;query: select max(a) from table&lt;BR /&gt;tMysqlInput-&amp;gt; in context variable.&lt;BR /&gt;I define context variable in this way:&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MFjM.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136700i60E95AAB0858BC43/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MFjM.png" alt="0683p000009MFjM.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;wrong I ?&lt;BR /&gt;Thnx at all&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2016 10:45:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Result-Query-to-context-variable/m-p/2341665#M109597</guid>
      <dc:creator>chichibio</dc:creator>
      <dc:date>2016-09-13T10:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Result Query to context variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Result-Query-to-context-variable/m-p/2341666#M109598</link>
      <description>No need to use a context for this. You can achieve this by using e.g. tOracleInput/tMySqlInput/... --&amp;gt; tFlowToIterate --&amp;gt; tOracleInput/tMySqlInput/... --&amp;gt; (everything else you want to do). The first input represents your query posted above (select max(a) from table).&amp;nbsp;&lt;BR /&gt;In tFlowToIterate you convert the input into a global variable which you can use in your next input like this:&amp;nbsp;&lt;BR /&gt;"select XYZ from TABLE2 WHERE COLUMN = " + ((String)globalMap.get("a"))&amp;nbsp;&lt;BR /&gt;(assuming that you named the column "a" in the schema of the first input and that it is of a numeric type).</description>
      <pubDate>Tue, 13 Sep 2016 20:33:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Result-Query-to-context-variable/m-p/2341666#M109598</guid>
      <dc:creator>JR1</dc:creator>
      <dc:date>2016-09-13T20:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Result Query to context variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Result-Query-to-context-variable/m-p/2341667#M109599</link>
      <description>&lt;BLOCKQUOTE&gt;
  JoRoesecke wrote: 
 &lt;BR /&gt;No need to use a context for this. You can achieve this by using e.g. tOracleInput/tMySqlInput/... --&amp;gt; tFlowToIterate --&amp;gt; tOracleInput/tMySqlInput/... --&amp;gt; (everything else you want to do). The first input represents your query posted above (select max(a) from table).&amp;nbsp; 
 &lt;BR /&gt;In tFlowToIterate you convert the input into a global variable which you can use in your next input like this:&amp;nbsp; 
 &lt;BR /&gt;"select XYZ from TABLE2 WHERE COLUMN = " + ((String)globalMap.get("a"))&amp;nbsp; 
 &lt;BR /&gt;(assuming that you named the column "a" in the schema of the first input and that it is of a numeric type). 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Hi Jo...thank you so much to your suggest. It's very simple.&amp;nbsp; 
&lt;BR /&gt;My job going execute fine, but no rows insert in my 2nd table: 
&lt;BR /&gt;I would compare the column_date to select new elements from 2nd table and insert/update in first table. 
&lt;BR /&gt;I would : select max(date) as a from table1-&amp;gt;result in variable-&amp;gt; "select * from table2 where column_date &amp;gt;"+((String)globalMap.get("a")) 
&lt;BR /&gt;I think that is not string. Exist ((Date)globalmap.get("a")) ?&amp;nbsp; 
&lt;BR /&gt;How I can do it? 
&lt;BR /&gt; 
&lt;BR /&gt;Thank so much 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MFjR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154064iB5A83533C2E51DA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MFjR.png" alt="0683p000009MFjR.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Mon, 19 Sep 2016 10:55:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Result-Query-to-context-variable/m-p/2341667#M109599</guid>
      <dc:creator>chichibio</dc:creator>
      <dc:date>2016-09-19T10:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Result Query to context variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Result-Query-to-context-variable/m-p/2341668#M109600</link>
      <description>Click on the "row1" link. Take a look at the schema. The tFlowToIterate will save the column data to the globalMap using the following format....&lt;BR /&gt;&lt;BR /&gt;[rowname].[columnname]&lt;BR /&gt;&lt;BR /&gt;So if your row1 link has a column called "myColumn", the tFlowToIterate will save it to a key of "row.myColumn". It is case sensitive.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So your query would be...&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;"select * from table2 where column_date &amp;gt;"+((String)globalMap.get("row1.myColumn"))&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Mon, 19 Sep 2016 12:24:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Result-Query-to-context-variable/m-p/2341668#M109600</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-19T12:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Result Query to context variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Result-Query-to-context-variable/m-p/2341669#M109601</link>
      <description>&lt;BLOCKQUOTE&gt;
  rhall_2.0 wrote: 
 &lt;BR /&gt;Click on the "row1" link. Take a look at the schema. The tFlowToIterate will save the column data to the globalMap using the following format.... 
 &lt;BR /&gt; 
 &lt;BR /&gt;[rowname].[columnname] 
 &lt;BR /&gt; 
 &lt;BR /&gt;So if your row1 link has a column called "myColumn", the tFlowToIterate will save it to a key of "row.myColumn". It is case sensitive.&amp;nbsp; 
 &lt;BR /&gt; 
 &lt;BR /&gt;So your query would be... 
 &lt;BR /&gt; 
 &lt;BR /&gt; 
 &lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;"select * from table2 where column_date &amp;gt;"+((String)globalMap.get("row1.myColumn"))&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;thnx to your suggest. But exactly I had problem with string, so I change that in this way: 
&lt;BR /&gt;"select * from tabl2 where column_date &amp;gt; '"+((java.util.Date)globalMap.get("row1.column_date"))+"'"; 
&lt;BR /&gt; 
&lt;BR /&gt;Finally I had click on row1 but I selected only column_date without other column from table1. 
&lt;BR /&gt;I resolved with your suggest and other little change 
&lt;BR /&gt; 
&lt;BR /&gt;thnx at all</description>
      <pubDate>Mon, 19 Sep 2016 15:13:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Result-Query-to-context-variable/m-p/2341669#M109601</guid>
      <dc:creator>chichibio</dc:creator>
      <dc:date>2016-09-19T15:13:51Z</dc:date>
    </item>
  </channel>
</rss>

