<?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 [resolved] SELECT query from tPostgresqlInput and storing reult in variable? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-SELECT-query-from-tPostgresqlInput-and-storing-reult-in/m-p/2210290#M8766</link>
    <description>Hi.
&lt;BR /&gt;My job is roughly this:
&lt;BR /&gt;
&lt;PRE&gt;tFileList --(iterate)-&amp;gt; tFileInputDelimited --(row1)-&amp;gt; tMap --(out1)-&amp;gt; tPostgresqlOutput&lt;BR /&gt; &amp;nbsp; |&lt;BR /&gt; &amp;nbsp; |&lt;BR /&gt;(iterate2)&lt;BR /&gt; &amp;nbsp; |&lt;BR /&gt; &amp;nbsp; v&lt;BR /&gt;tPostgresqlInput (for calling SELECT function() to further process data in db)&lt;/PRE&gt;
&lt;BR /&gt;ie. I load data from files (iterating) to a DB and after each
&lt;BR /&gt;iteration, I call a function in 
&lt;B&gt;tPostgresqlInput &lt;/B&gt;to further 
&lt;BR /&gt;process the data in the DB. The function returns a value
&lt;BR /&gt;that I would like to write to a variable and later write to a
&lt;BR /&gt;log file of as sort. But how do I write the value to a 
&lt;BR /&gt;variable?
&lt;BR /&gt;Later in process the file writing part would connect to 
&lt;BR /&gt;the 
&lt;B&gt;tFileList&lt;/B&gt; above with another iterate arrow (
&lt;B&gt;iterate3&lt;/B&gt;) 
&lt;BR /&gt;to log the file name loaded and the value returned from 
&lt;BR /&gt;the function, pretty much like this:
&lt;BR /&gt;
&lt;PRE&gt;   ...&lt;BR /&gt;    |&lt;BR /&gt;(iterate3)&lt;BR /&gt;    |&lt;BR /&gt;    v&lt;BR /&gt;tFileProperties-(row3)-&amp;gt;tMap -(out3)-&amp;gt; tFileOutputDelimited&lt;BR /&gt;&lt;/PRE&gt;
&lt;BR /&gt;So basically my question is: how to write a single value
&lt;BR /&gt;selected from tPostgresqlInput to a variable?
&lt;BR /&gt;JB</description>
    <pubDate>Tue, 25 Nov 2014 09:25:07 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2014-11-25T09:25:07Z</dc:date>
    <item>
      <title>[resolved] SELECT query from tPostgresqlInput and storing reult in variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-SELECT-query-from-tPostgresqlInput-and-storing-reult-in/m-p/2210290#M8766</link>
      <description>Hi.
&lt;BR /&gt;My job is roughly this:
&lt;BR /&gt;
&lt;PRE&gt;tFileList --(iterate)-&amp;gt; tFileInputDelimited --(row1)-&amp;gt; tMap --(out1)-&amp;gt; tPostgresqlOutput&lt;BR /&gt; &amp;nbsp; |&lt;BR /&gt; &amp;nbsp; |&lt;BR /&gt;(iterate2)&lt;BR /&gt; &amp;nbsp; |&lt;BR /&gt; &amp;nbsp; v&lt;BR /&gt;tPostgresqlInput (for calling SELECT function() to further process data in db)&lt;/PRE&gt;
&lt;BR /&gt;ie. I load data from files (iterating) to a DB and after each
&lt;BR /&gt;iteration, I call a function in 
&lt;B&gt;tPostgresqlInput &lt;/B&gt;to further 
&lt;BR /&gt;process the data in the DB. The function returns a value
&lt;BR /&gt;that I would like to write to a variable and later write to a
&lt;BR /&gt;log file of as sort. But how do I write the value to a 
&lt;BR /&gt;variable?
&lt;BR /&gt;Later in process the file writing part would connect to 
&lt;BR /&gt;the 
&lt;B&gt;tFileList&lt;/B&gt; above with another iterate arrow (
&lt;B&gt;iterate3&lt;/B&gt;) 
&lt;BR /&gt;to log the file name loaded and the value returned from 
&lt;BR /&gt;the function, pretty much like this:
&lt;BR /&gt;
&lt;PRE&gt;   ...&lt;BR /&gt;    |&lt;BR /&gt;(iterate3)&lt;BR /&gt;    |&lt;BR /&gt;    v&lt;BR /&gt;tFileProperties-(row3)-&amp;gt;tMap -(out3)-&amp;gt; tFileOutputDelimited&lt;BR /&gt;&lt;/PRE&gt;
&lt;BR /&gt;So basically my question is: how to write a single value
&lt;BR /&gt;selected from tPostgresqlInput to a variable?
&lt;BR /&gt;JB</description>
      <pubDate>Tue, 25 Nov 2014 09:25:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-SELECT-query-from-tPostgresqlInput-and-storing-reult-in/m-p/2210290#M8766</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-11-25T09:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] SELECT query from tPostgresqlInput and storing reult in variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-SELECT-query-from-tPostgresqlInput-and-storing-reult-in/m-p/2210291#M8767</link>
      <description>Hi,&lt;BR /&gt;&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;You can use tJavaRow &amp;nbsp;to save each value to a variable for re-use in the next Input component.&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;Best regards&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;Sabrina&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Wed, 26 Nov 2014 08:16:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-SELECT-query-from-tPostgresqlInput-and-storing-reult-in/m-p/2210291#M8767</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-26T08:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] SELECT query from tPostgresqlInput and storing reult in variable?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-SELECT-query-from-tPostgresqlInput-and-storing-reult-in/m-p/2210292#M8768</link>
      <description>OK, I solved this with &lt;B&gt;tSetGlobalVar&lt;/B&gt; component like this:&lt;BR /&gt;&lt;PRE&gt;tFileList --(iterate)-&amp;gt; tFileInputDelimited --(row1)-&amp;gt; tMap --(out1)-&amp;gt; tPostgresqlOutput&lt;BR /&gt; &amp;nbsp;| &amp;nbsp; |&lt;BR /&gt; &amp;nbsp;| &amp;nbsp; |&lt;BR /&gt; &amp;nbsp;| (iterate2)&lt;BR /&gt; &amp;nbsp;|&amp;nbsp; &amp;nbsp;|&lt;BR /&gt; &amp;nbsp;| &amp;nbsp; v&lt;BR /&gt; &amp;nbsp;| &amp;nbsp;tPostgresqlInput --(row2)-&amp;gt; tSetGlobalVar&lt;BR /&gt; &amp;nbsp;|&lt;BR /&gt; &amp;nbsp;|&lt;BR /&gt;(iterate3)&lt;BR /&gt; &amp;nbsp;|&lt;BR /&gt; &amp;nbsp;v&lt;BR /&gt; tFileproperties --(row3)-&amp;gt; tMap --(out2)-&amp;gt; tFileOutputDelimited &lt;/PRE&gt;&lt;BR /&gt;Then in components:&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;tPostgresqlInput&lt;/B&gt;: add field in schema for the value (&lt;B&gt;code&lt;/B&gt;)&lt;BR /&gt;&lt;B&gt;tSetGlobalVar&lt;/B&gt;: &lt;B&gt;"code"&lt;/B&gt; as key, &lt;B&gt;row3.code&lt;/B&gt; for value&lt;BR /&gt;&lt;B&gt;tMap&lt;/B&gt;: &lt;B&gt;((String)globalMap.get("code"))&lt;/B&gt; in &lt;B&gt;out2&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;Please feel free to share better solutions.&lt;BR /&gt;JB</description>
      <pubDate>Wed, 26 Nov 2014 08:25:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-SELECT-query-from-tPostgresqlInput-and-storing-reult-in/m-p/2210292#M8768</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-11-26T08:25:04Z</dc:date>
    </item>
  </channel>
</rss>

