<?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: Using a datetime context variable in tMSSQLInput to filter the records in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Using-a-datetime-context-variable-in-tMSSQLInput-to-filter-the/m-p/2332278#M101176</link>
    <description>&lt;P&gt;Thanks a lot, it works for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For another client, I did this and working fine at that time --&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;--tMSSQLInput&amp;nbsp; - &lt;/SPAN&gt;where mod_dt&amp;gt;'"+context.accounts_etl_date+"'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this time, I have format context value --&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;--tMSSQLInput&amp;nbsp; - where createdDate &amp;gt; '" + TalendDate.formatDate("yyyy-MM-dd HH:mm:ss.SSS",context.max_created)+"'"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks a lot&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Feb 2019 10:51:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-02-05T10:51:25Z</dc:date>
    <item>
      <title>Using a datetime context variable in tMSSQLInput to filter the records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-a-datetime-context-variable-in-tMSSQLInput-to-filter-the/m-p/2332274#M101172</link>
      <description>Hello,
&lt;BR /&gt;I am trying to read a max datetime from SQL Server DB (using tMSSQLInput1) to set a context variable that is then passed to another tMSSQLInput2 and used to filter the query in that component to write to a DW. I have not been able to successfully get tMSSQLInput2 to recognize the context variable being passed in. I had a tLogRow that captured/displayed the variable correctly but I'm not convinced the variable is being passed as displayed in tLogRow, or recognized as a datetime. I am getting a NullPointerException error, and others depending on how I'm trying to pass the variable.
&lt;BR /&gt;Current job:
&lt;BR /&gt;tMSSQLInput1 --- max_created (datetime format) -- tFlowToItereate
&lt;BR /&gt;|
&lt;BR /&gt;-Iterate
&lt;BR /&gt;|
&lt;BR /&gt;--tMSSQLInput&amp;nbsp; - where createdDate &amp;gt; '" + TalendDate.formatDate("yyyy-MM-dd HH:mm:ss.SSS",context.max_created)+"'"</description>
      <pubDate>Thu, 19 May 2016 19:20:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-a-datetime-context-variable-in-tMSSQLInput-to-filter-the/m-p/2332274#M101172</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-19T19:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using a datetime context variable in tMSSQLInput to filter the records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-a-datetime-context-variable-in-tMSSQLInput-to-filter-the/m-p/2332275#M101173</link>
      <description>flowtoiterate does not save the value in context.columnname but in&amp;nbsp; (String)globalMap.get("rowname.columnname")&lt;BR /&gt;( if you have switch on standartbehaivor)&lt;BR /&gt;HTH&lt;BR /&gt;dj</description>
      <pubDate>Fri, 20 May 2016 09:58:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-a-datetime-context-variable-in-tMSSQLInput-to-filter-the/m-p/2332275#M101173</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-20T09:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using a datetime context variable in tMSSQLInput to filter the records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-a-datetime-context-variable-in-tMSSQLInput-to-filter-the/m-p/2332276#M101174</link>
      <description>thanks dj, 
&lt;BR /&gt;I was able to solve by adding a tFixedDlowInput and tContextLoad. In the tFixedFlow I'm using (String)globalMap.get("row2.max_created") to assign the context. 
&lt;BR /&gt;I may have painted myself into a corner though because what I'm now working on is the ability to assign 2 variables, max_created and max_modified with the end goal of filtering the SQL as such: where createdDate &amp;gt; max_created OR modifiedDate &amp;gt; max_modified. 
&lt;BR /&gt;I think I can do this with the current components. Currently in the FlowtoItereate I am using the default (key,value) in global variables which seems to only allow one variable at a time. But I might be able to deselect the 'use default key/value' and define my own. 
&lt;BR /&gt;Current job: 
&lt;BR /&gt;tSQLInput --- max_created(string format) ---&amp;gt; tFlowToIterate (using default global variables - iterate) ---- tFixedFlowInput ((String)globalMap.get("row2.max_created") ----&amp;gt; tContextLoad 
&lt;BR /&gt;| 
&lt;BR /&gt;OnSubjobOK 
&lt;BR /&gt;| 
&lt;BR /&gt;tSQLInput - 
&lt;BR /&gt;where createdDate &amp;gt; '" + TalendDate.formatDate("yyyy-MM-dd HH:mm:ss.SSS",context.max_created)+"'" 
&lt;BR /&gt;I'll post back on how I solve it but if anyone has sugestions they are greatly appreciated.</description>
      <pubDate>Fri, 20 May 2016 17:59:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-a-datetime-context-variable-in-tMSSQLInput-to-filter-the/m-p/2332276#M101174</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-20T17:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using a datetime context variable in tMSSQLInput to filter the records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-a-datetime-context-variable-in-tMSSQLInput-to-filter-the/m-p/2332277#M101175</link>
      <description>Default (key value) Option gives you ALL columns of the Input row in form of globalMap.get("row_nr.columnName"), not only one&amp;nbsp; so it should work . Manipulation of the SQL Statement as you showed is exactly what i do in such cases.</description>
      <pubDate>Mon, 23 May 2016 17:24:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-a-datetime-context-variable-in-tMSSQLInput-to-filter-the/m-p/2332277#M101175</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-23T17:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using a datetime context variable in tMSSQLInput to filter the records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-a-datetime-context-variable-in-tMSSQLInput-to-filter-the/m-p/2332278#M101176</link>
      <description>&lt;P&gt;Thanks a lot, it works for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For another client, I did this and working fine at that time --&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;--tMSSQLInput&amp;nbsp; - &lt;/SPAN&gt;where mod_dt&amp;gt;'"+context.accounts_etl_date+"'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this time, I have format context value --&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;--tMSSQLInput&amp;nbsp; - where createdDate &amp;gt; '" + TalendDate.formatDate("yyyy-MM-dd HH:mm:ss.SSS",context.max_created)+"'"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks a lot&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 10:51:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-a-datetime-context-variable-in-tMSSQLInput-to-filter-the/m-p/2332278#M101176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-05T10:51:25Z</dc:date>
    </item>
  </channel>
</rss>

