<?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] context values for sql query in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368610#M131858</link>
    <description>Hello!&lt;BR /&gt;Anyone?&lt;BR /&gt;Thank you!</description>
    <pubDate>Fri, 06 May 2016 16:28:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-05-06T16:28:13Z</dc:date>
    <item>
      <title>[resolved] context values for sql query</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368609#M131857</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;I want use some context values for sql query.&lt;BR /&gt;Query will be something like: select * from table where value in (context.values);&lt;BR /&gt;Those context values are stored in a txt file and they are several, like: monday, friday, saturday.&lt;BR /&gt;the query returns no values, because it's looking for context like a string.&lt;BR /&gt;How can I make i read context like separated values?&lt;BR /&gt;Or is there other better solution?&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2016 21:25:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368609#M131857</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-04T21:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] context values for sql query</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368610#M131858</link>
      <description>Hello!&lt;BR /&gt;Anyone?&lt;BR /&gt;Thank you!</description>
      <pubDate>Fri, 06 May 2016 16:28:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368610#M131858</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-06T16:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] context values for sql query</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368611#M131859</link>
      <description>&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;In your t{DB}Input component, you will notice that the SQL is within quotes. It is basically a Java String. All you need to do is build your query (its good practice to name your columns explicitly by the way) and then concatenate your context variable to the query like below....&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;"SELECT Col1, Col2, Col3 FROM mytable WHERE talend_context =" +context.yourVal&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;If you are concatenating a String value, then you will need to add single quotes, for example....&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;"SELECT Col1, Col2, Col3 FROM mytable WHERE talend_context ='" +context.yourVal +"'"&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;FONT size="1"&gt;&lt;FONT face="Verdana," helvetica=""&gt;As I said, all you are doing is building a query String in Java. So as long as your String results in a legitimate SQL query (and your columns match your schema), it will work.&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Fri, 06 May 2016 16:31:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368611#M131859</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-06T16:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] context values for sql query</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368612#M131860</link>
      <description>Hi.
&lt;BR /&gt;Thanks for your answer. I saw an old post from you referring this, but I still have the problem.
&lt;BR /&gt;My query is: Select city, country from companies where city in ('lisbon','london') - This works in a DBA Manager.
&lt;BR /&gt;I have the same query like this "Select city, country from companies where city in" +context.city+
&lt;BR /&gt;on text file that hold the context info, I have: lisbon','london this does not work beacause it's a string, so it's looking for the exact value: lisbon','london
&lt;BR /&gt;If I put in the text file: 'lisbon','london', it throws an error "remove the quotes"...
&lt;BR /&gt;So Any help will be appreciated!</description>
      <pubDate>Mon, 09 May 2016 16:01:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368612#M131860</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-09T16:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] context values for sql query</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368613#M131861</link>
      <description>the example you've been provided with shows you how you construct the statement.&lt;BR /&gt;you need to make sure that you're constructing valid SQL.&lt;BR /&gt;In this instance, your context value needs to be set to: - "('lisbon', 'london')".&lt;BR /&gt;In your question above, you have no space after "in". You need it.&lt;BR /&gt;You just need to make sure that you're creating valid SQL.</description>
      <pubDate>Mon, 09 May 2016 18:30:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368613#M131861</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-09T18:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] context values for sql query</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368614#M131862</link>
      <description>Hi.&lt;BR /&gt;Now it's ok and I "got the picture".&lt;BR /&gt;It works like a string replacement.&lt;BR /&gt;Thank you!!</description>
      <pubDate>Wed, 11 May 2016 17:31:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-context-values-for-sql-query/m-p/2368614#M131862</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-11T17:31:55Z</dc:date>
    </item>
  </channel>
</rss>

