<?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 Get result of query as variable  for each iteration in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Get-result-of-query-as-variable-for-each-iteration/m-p/2290940#M64171</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a tdbinput which uses a select query like "select A,B,C from test"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to store the extracted values per each iteration from the database table into a context variable so i can use it later using tjava or tjavarow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using tsetglobalvar in the flow like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TDBINPUT-main--&amp;gt;TSETGLOBALVAR---main---&amp;gt;TJAVAROW&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iterate does not work above,it only accepts main row for each connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i use context,it only retains the latest value,i would want for each &lt;/P&gt;&lt;B&gt;iteration&lt;/B&gt;&lt;P&gt; the results to get stored and processed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My tjavarow has:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;context.Atest=input_row.A;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the correct way to extract and store in context for each row in the database&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 23:07:35 GMT</pubDate>
    <dc:creator>TJane1641356540</dc:creator>
    <dc:date>2024-11-15T23:07:35Z</dc:date>
    <item>
      <title>Get result of query as variable  for each iteration</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-result-of-query-as-variable-for-each-iteration/m-p/2290940#M64171</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a tdbinput which uses a select query like "select A,B,C from test"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to store the extracted values per each iteration from the database table into a context variable so i can use it later using tjava or tjavarow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using tsetglobalvar in the flow like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TDBINPUT-main--&amp;gt;TSETGLOBALVAR---main---&amp;gt;TJAVAROW&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iterate does not work above,it only accepts main row for each connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when i use context,it only retains the latest value,i would want for each &lt;/P&gt;&lt;B&gt;iteration&lt;/B&gt;&lt;P&gt; the results to get stored and processed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My tjavarow has:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;context.Atest=input_row.A;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the correct way to extract and store in context for each row in the database&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:07:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-result-of-query-as-variable-for-each-iteration/m-p/2290940#M64171</guid>
      <dc:creator>TJane1641356540</dc:creator>
      <dc:date>2024-11-15T23:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get result of query as variable  for each iteration</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Get-result-of-query-as-variable-for-each-iteration/m-p/2290941#M64172</link>
      <description>&lt;P&gt;Use a tFlowToIterate component here. It will store each row's columns in the globalMap and iterate from that component. Everything that follows that component will fire completely for each row of data. The globalMap keys will be in the format....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{row name}.{column name}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So a String from "row1" with a column name of "myVal" will be retrieved like this....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;((String)globalMap.get("row1.myVal"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2022 00:04:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Get-result-of-query-as-variable-for-each-iteration/m-p/2290941#M64172</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-12T00:04:14Z</dc:date>
    </item>
  </channel>
</rss>

