<?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: [resolved] Syntax error when using global variable in where clause in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296584#M69236</link>
    <description>Which database type do you query? TO_DATE() is an Oracle-only function.</description>
    <pubDate>Tue, 06 Dec 2016 06:52:48 GMT</pubDate>
    <dc:creator>JR1</dc:creator>
    <dc:date>2016-12-06T06:52:48Z</dc:date>
    <item>
      <title>[resolved] Syntax error when using global variable in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296579#M69231</link>
      <description>&lt;P&gt;I am trying to use a global variable as part of my where clause in a JDBCInput component. &amp;nbsp;I want to select all records where the LOAD_TS (load date) is greater than the minUpdateDate (my global variable) --i.e. the last time the job ran.&lt;BR /&gt;I can't seem to get the syntax right, i think it should be something along these lines but i get the following errors. &amp;nbsp;Can anyone assist?&lt;BR /&gt;"select * from OPUB_WXDM_TM_PD tm&lt;BR /&gt;where tm.LOAD_TS&amp;gt;&amp;nbsp;&lt;BR /&gt;TO_DATE(' "&lt;BR /&gt;+ &amp;nbsp;TalendDate.formatDate("MM/dd/yyyy HH:mm:ss", (Date)globalMap.get("minUpdateDate"))&lt;BR /&gt;+ " &amp;nbsp;', 'MM/DD/YYYY HH24:MI&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M9p6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134116iFBD5D7F21624A744/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M9p6.png" alt="0683p000009M9p6.png" /&gt;&lt;/span&gt;S')"&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 18:50:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296579#M69231</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-05T18:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Syntax error when using global variable in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296580#M69232</link>
      <description>You have forgotten to post the errors you are getting. Can you please tell us how you fill the global variable? Do you really put a date in there?</description>
      <pubDate>Mon, 05 Dec 2016 20:29:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296580#M69232</guid>
      <dc:creator>JR1</dc:creator>
      <dc:date>2016-12-05T20:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Syntax error when using global variable in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296581#M69233</link>
      <description>Hi, 
&lt;BR /&gt;What if you replace&amp;nbsp; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;+ " &amp;nbsp;', 'MM/DD/YYYY HH24:MI&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M9p6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134116iFBD5D7F21624A744/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M9p6.png" alt="0683p000009M9p6.png" /&gt;&lt;/span&gt;S')"&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;by&amp;nbsp; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;+ " ', 'MM/DD/YYYY HH24:MI&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M9p6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134116iFBD5D7F21624A744/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M9p6.png" alt="0683p000009M9p6.png" /&gt;&lt;/span&gt;S')"&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;?</description>
      <pubDate>Mon, 05 Dec 2016 22:02:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296581#M69233</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2016-12-05T22:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Syntax error when using global variable in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296582#M69234</link>
      <description>Here is the error I am receiving. &amp;nbsp;I do need to use the date to determine whether or not the job needs to run. &amp;nbsp;It must be something with the way I'm formatting it 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;&amp;nbsp; 
&lt;BR /&gt;Start Job Vars: 
&lt;BR /&gt;Job Name: OPUB_WXDM_TM_PD_grayner 
&lt;BR /&gt;Job Hist ID: 3247 
&lt;BR /&gt;Min Update Date: Fri Jan 01 00:00:00 PST 2016 
&lt;BR /&gt;Min ID: 0 
&lt;BR /&gt;maxUpdateDate: 2016-11-30 00:00:00.0 
&lt;BR /&gt;Exception in component tJDBCInput_1 
&lt;BR /&gt;org.teiid.jdbc.TeiidSQLException: TEIID30068 Remote org.teiid.api.exception.query.QueryResolverException: TEIID30068 The function 'TO_DATE(' 01/01/2016 00:00:00 &amp;nbsp;', 'MM/DD/YYYY HH24:MI 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M9p6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134116iFBD5D7F21624A744/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M9p6.png" alt="0683p000009M9p6.png" /&gt;&lt;/span&gt;S')' is an unknown form. &amp;nbsp;Check that the function name and number of arguments is correct. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;A href="https://community.talend.com/legacyfs/online/387454/variable-error.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MG4o.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129768iFB9A9F50CC2D5B9E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MG4o.jpg" alt="0683p000009MG4o.jpg" /&gt;&lt;/span&gt; &lt;/A&gt;</description>
      <pubDate>Mon, 05 Dec 2016 22:14:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296582#M69234</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-05T22:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Syntax error when using global variable in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296583#M69235</link>
      <description>Here is the format of my variable within the job as well
&lt;BR /&gt;
&lt;A href="https://community.talend.com/legacyfs/online/387454/screen_shot-of-job-and-variable-format.jpg" target="_blank"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MFwc.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141300i712AAF099BEE7C30/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MFwc.jpg" alt="0683p000009MFwc.jpg" /&gt;&lt;/span&gt; &lt;/A&gt;</description>
      <pubDate>Mon, 05 Dec 2016 22:19:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296583#M69235</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-05T22:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Syntax error when using global variable in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296584#M69236</link>
      <description>Which database type do you query? TO_DATE() is an Oracle-only function.</description>
      <pubDate>Tue, 06 Dec 2016 06:52:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296584#M69236</guid>
      <dc:creator>JR1</dc:creator>
      <dc:date>2016-12-06T06:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Syntax error when using global variable in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296585#M69237</link>
      <description>In the query I am comparing a date (LOAD_TS) &amp;nbsp;from a JDBC database to a global variable date (minupdatedate) which is coming from an oracle database so that is why I was using TO_DATE should I be formatting the LOAD_TS instead or am I just not using the right format? 
&lt;BR /&gt;LOAD_TS format:&amp;nbsp;2016-12-06 00:00:00 (JDBC) 
&lt;BR /&gt;Min Update Date:&amp;nbsp;Wed Nov 30 00:00:00 PST 2016 
&lt;BR /&gt;within the JDBC component&amp;nbsp; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;"select * from OPUB_WXDM_TM_PD tm&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;where tm.LOAD_TS&amp;gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;TO_DATE(' "&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;+ &amp;nbsp;TalendDate.formatDate("MM/dd/yyyy HH:mm:ss", (Date)globalMap.get("minUpdateDate"))&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;+ " &amp;nbsp;', 'MM/DD/YYYY HH24:MI&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M9p6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134116iFBD5D7F21624A744/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M9p6.png" alt="0683p000009M9p6.png" /&gt;&lt;/span&gt;S')"&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Tue, 06 Dec 2016 18:15:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296585#M69237</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-06T18:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Syntax error when using global variable in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296586#M69238</link>
      <description>Try to remove spaces before and after the date. 
&lt;BR /&gt;What if you try the same when directly connected to the database (not from TOS)? 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;TRF</description>
      <pubDate>Tue, 06 Dec 2016 20:42:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296586#M69238</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2016-12-06T20:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Syntax error when using global variable in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296587#M69239</link>
      <description>removing the spaces was part of the issue (thank you!). 
&lt;BR /&gt;I believe the underlying source database is mysql (belongs to an outside vendor), however there is a jdbc application layer on top of it. &amp;nbsp; I am able to get the syntax for the query to work:&amp;nbsp; 
&lt;BR /&gt;"select * from OPUB_WXDM_TM_PD 
&lt;BR /&gt;where load_ts &amp;gt;= DATE '"+TalendDate.formatDate("yyyy-MM-dd", (Date)globalMap.get("minUpdateDate"))+"' 
&lt;BR /&gt;" 
&lt;BR /&gt;BUT the greater than or equal to is not working because although the database object for the the LOAD_TS field is noted as 'DATE' it looks like its a timestamp. &amp;nbsp;Is that possible (I am not familiar with mysql)? &amp;nbsp;There appears to be this extra 2016-12-06 00:00:00.0 at the end. &amp;nbsp;When I change the query to TIMESTAMP it still brings back all records. &amp;nbsp;Any thoughts on why this is happening? 
&lt;BR /&gt;"select * from OPUB_WXDM_TM_PD 
&lt;BR /&gt;where load_ts &amp;gt;= TIMESTAMP '"+TalendDate.formatDate("yyyy-MM-dd HH:mm:ss.S", (Date)globalMap.get("minUpdateDate"))+"' 
&lt;BR /&gt;" 
&lt;BR /&gt; 
&lt;BR /&gt;&amp;nbsp; &amp;nbsp;</description>
      <pubDate>Thu, 08 Dec 2016 01:47:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296587#M69239</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-08T01:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Syntax error when using global variable in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296588#M69240</link>
      <description>not sure - You are start from Oracle, then MySQL ...
&lt;BR /&gt;
&lt;BR /&gt;but generally - You do not need worry about right parts, You must check You left parts
&lt;BR /&gt;query send to database always as string so,&amp;nbsp;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;PRE&gt;select * from OPUB_WXDM_TM_PD &lt;BR /&gt;where load_ts &amp;gt;= '"+TalendDate.formatDate("yyyy-MM-dd", (Date)globalMap.get("minUpdateDate"))+"'&lt;/PRE&gt;
&lt;BR /&gt;
&lt;BR /&gt;must be ok, if load_ts - date, You just need worry about proper form of string TalendDate.formatDate("yyyy-MM-dd", (Date)globalMap.get("minUpdateDate"))
&lt;BR /&gt;do not need any additional functions</description>
      <pubDate>Thu, 08 Dec 2016 22:39:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296588#M69240</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2016-12-08T22:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Syntax error when using global variable in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296589#M69241</link>
      <description>i was able to reformat the input date and now good to go thank you!</description>
      <pubDate>Thu, 08 Dec 2016 22:44:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Syntax-error-when-using-global-variable-in-where-clause/m-p/2296589#M69241</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-08T22:44:27Z</dc:date>
    </item>
  </channel>
</rss>

