<?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 global variable in SQL inside lookup not working as advertised in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/global-variable-in-SQL-inside-lookup-not-working-as-advertised/m-p/2310521#M81644</link>
    <description>&lt;P&gt;Talend 6.0&lt;BR /&gt;Linux 6.5&lt;BR /&gt;&lt;BR /&gt;If you look at the Talend Help Center doc at&amp;nbsp;&lt;A href="https://help.talend.com/search/all?query=Handling+Lookups" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://help.talend.com/search/all?query=Handling+Lookups&lt;/A&gt;&lt;BR /&gt;you will see an example of using a global variable in a lookup. &amp;nbsp;This is exactly what I want to do but I cannot get the SQL&amp;nbsp;&lt;BR /&gt;to parse correctly as described in the Help Center document.&lt;BR /&gt;It uses as an example SQL&lt;/P&gt; 
&lt;PRE&gt;"Select * from person where id=" (Integer)globalMap.get("id")"&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="consolas,"&gt;but when I enter my lookup SQL as a Built-In Query Type (see below) I get syntax errors - is the doc incorrect or is it my SQL?&lt;/FONT&gt;&lt;/P&gt; 
&lt;PRE&gt;"select PayCode, PayId&lt;BR /&gt;from Payment &lt;BR /&gt;where MaximumPay &amp;gt;= "   (Integer)globalMap.get("Pay")   "&lt;BR /&gt;and MinimumPay &amp;lt;= "   (Integer)globalMap.get("Pay")"&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;My error message is:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt; 
&lt;PRE&gt;String literal is not properly closed by double-quote&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;Added notes: &amp;nbsp;Tried \"Pay\" with no luck. &amp;nbsp;"Pay" is a global variable set with tSetGlobalVar prior to the lookup and the Lookup Model is set to "Reload at each row".&lt;/P&gt;</description>
    <pubDate>Sun, 15 Nov 2015 22:34:17 GMT</pubDate>
    <dc:creator>tale103108</dc:creator>
    <dc:date>2015-11-15T22:34:17Z</dc:date>
    <item>
      <title>global variable in SQL inside lookup not working as advertised</title>
      <link>https://community.qlik.com/t5/Talend-Studio/global-variable-in-SQL-inside-lookup-not-working-as-advertised/m-p/2310521#M81644</link>
      <description>&lt;P&gt;Talend 6.0&lt;BR /&gt;Linux 6.5&lt;BR /&gt;&lt;BR /&gt;If you look at the Talend Help Center doc at&amp;nbsp;&lt;A href="https://help.talend.com/search/all?query=Handling+Lookups" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://help.talend.com/search/all?query=Handling+Lookups&lt;/A&gt;&lt;BR /&gt;you will see an example of using a global variable in a lookup. &amp;nbsp;This is exactly what I want to do but I cannot get the SQL&amp;nbsp;&lt;BR /&gt;to parse correctly as described in the Help Center document.&lt;BR /&gt;It uses as an example SQL&lt;/P&gt; 
&lt;PRE&gt;"Select * from person where id=" (Integer)globalMap.get("id")"&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="consolas,"&gt;but when I enter my lookup SQL as a Built-In Query Type (see below) I get syntax errors - is the doc incorrect or is it my SQL?&lt;/FONT&gt;&lt;/P&gt; 
&lt;PRE&gt;"select PayCode, PayId&lt;BR /&gt;from Payment &lt;BR /&gt;where MaximumPay &amp;gt;= "   (Integer)globalMap.get("Pay")   "&lt;BR /&gt;and MinimumPay &amp;lt;= "   (Integer)globalMap.get("Pay")"&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;My error message is:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt; 
&lt;PRE&gt;String literal is not properly closed by double-quote&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;Added notes: &amp;nbsp;Tried \"Pay\" with no luck. &amp;nbsp;"Pay" is a global variable set with tSetGlobalVar prior to the lookup and the Lookup Model is set to "Reload at each row".&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2015 22:34:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/global-variable-in-SQL-inside-lookup-not-working-as-advertised/m-p/2310521#M81644</guid>
      <dc:creator>tale103108</dc:creator>
      <dc:date>2015-11-15T22:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: global variable in SQL inside lookup not working as advertised</title>
      <link>https://community.qlik.com/t5/Talend-Studio/global-variable-in-SQL-inside-lookup-not-working-as-advertised/m-p/2310522#M81645</link>
      <description>You don't need the quote at the end.&lt;BR /&gt;Try....&lt;BR /&gt;&lt;PRE&gt;"select PayCode, PayId&lt;BR /&gt;from Payment &lt;BR /&gt;where MaximumPay &amp;gt;= " + (Integer)globalMap.get("Pay") + "&lt;BR /&gt;and MinimumPay &amp;lt;= " + (Integer)globalMap.get("Pay")&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Nov 2015 00:41:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/global-variable-in-SQL-inside-lookup-not-working-as-advertised/m-p/2310522#M81645</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-16T00:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: global variable in SQL inside lookup not working as advertised</title>
      <link>https://community.qlik.com/t5/Talend-Studio/global-variable-in-SQL-inside-lookup-not-working-as-advertised/m-p/2310523#M81646</link>
      <description>Thank you&amp;nbsp;
&lt;FONT color="#5b5b5d"&gt;&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;rhall_2.0, that worked.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Wed, 18 Nov 2015 22:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/global-variable-in-SQL-inside-lookup-not-working-as-advertised/m-p/2310523#M81646</guid>
      <dc:creator>tale103108</dc:creator>
      <dc:date>2015-11-18T22:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: global variable in SQL inside lookup not working as advertised</title>
      <link>https://community.qlik.com/t5/Talend-Studio/global-variable-in-SQL-inside-lookup-not-working-as-advertised/m-p/2310524#M81647</link>
      <description>To explain, you only need to place double quotes in SQL statements, the globalMap statements arent SQL so thats why they are outside the double quotes, and appended to the SQL statements with the + sign.</description>
      <pubDate>Thu, 19 Nov 2015 01:47:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/global-variable-in-SQL-inside-lookup-not-working-as-advertised/m-p/2310524#M81647</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-19T01:47:45Z</dc:date>
    </item>
  </channel>
</rss>

