<?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: How could use context variable with OR clause in sql in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-could-use-context-variable-with-OR-clause-in-sql/m-p/2348082#M115251</link>
    <description>&lt;P&gt;The query looks like:&lt;/P&gt;&lt;P&gt;"Select x,y,z from tablename where x=“+context.x+" and y in "+context.y&lt;/P&gt;&lt;P&gt;before executing the query, you can set the value of context variable on tJava/tJavaFlex component, eg:&lt;/P&gt;&lt;P&gt;...tJava--onComponentOK--tMysqlInput--main--...&lt;/P&gt;&lt;P&gt;on tJava:&lt;/P&gt;&lt;P&gt;context.x="900";&lt;/P&gt;&lt;P&gt;context.y="('T01','U01','D01')";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jun 2021 02:37:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-06-15T02:37:52Z</dc:date>
    <item>
      <title>How could use context variable with OR clause in sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-could-use-context-variable-with-OR-clause-in-sql/m-p/2348080#M115249</link>
      <description>&lt;P&gt;Hello , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have query &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select &lt;/P&gt;&lt;P&gt;x&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;y&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;z&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;w  &lt;/P&gt;&lt;P&gt;from &lt;/P&gt;table_name&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where  &lt;/P&gt;(&lt;P&gt;x&lt;/P&gt;= &lt;P&gt;900&lt;/P&gt;) &lt;P&gt;AND &lt;/P&gt;( ( &lt;P&gt;y&lt;/P&gt;=&lt;P&gt;'F01'&lt;/P&gt;) &lt;P&gt;OR  &lt;/P&gt;(&lt;P&gt;y&lt;/P&gt;=&lt;P&gt;'CIP'&lt;/P&gt;)  &lt;P&gt;OR  &lt;/P&gt;(&lt;P&gt;y&lt;/P&gt;=&lt;P&gt;'T01'&lt;/P&gt;)  &lt;P&gt;OR  &lt;/P&gt;(&lt;P&gt;y&lt;/P&gt;=&lt;P&gt;'U01'&lt;/P&gt;)  &lt;P&gt;OR &lt;/P&gt;(&lt;P&gt;y&lt;/P&gt;=&lt;P&gt;'L01' &lt;/P&gt;))&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to contextialize my variable x and y . &lt;/P&gt;&lt;P&gt;I know that  my query would  be &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select &lt;/P&gt;&lt;P&gt;x&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;y&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;z&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;w  &lt;/P&gt;&lt;P&gt;from &lt;/P&gt;table_name&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where  &lt;/P&gt;(context.&lt;P&gt;x&lt;/P&gt;= &lt;P&gt;900&lt;/P&gt;) &lt;P&gt;AND &lt;/P&gt;( (&lt;B&gt;context.&lt;/B&gt;&lt;B&gt; &lt;/B&gt;&lt;B&gt;y&lt;/B&gt;=&lt;P&gt;'F01'&lt;/P&gt;) &lt;P&gt;OR  &lt;/P&gt;(&lt;B&gt;context.&lt;/B&gt;&lt;B&gt;y&lt;/B&gt;=&lt;P&gt;'CIP'&lt;/P&gt;)  &lt;P&gt;OR  &lt;/P&gt;(&lt;B&gt;context.&lt;/B&gt;&lt;B&gt;y&lt;/B&gt;=&lt;P&gt;'T01'&lt;/P&gt;)  &lt;P&gt;OR  &lt;/P&gt;(&lt;B&gt;context.&lt;/B&gt;&lt;B&gt;y&lt;/B&gt;=&lt;P&gt;'U01'&lt;/P&gt;)  &lt;P&gt;OR &lt;/P&gt;(&lt;B&gt;context.&lt;/B&gt;&lt;B&gt;y&lt;/B&gt;=&lt;P&gt;'L01' &lt;/P&gt;))   &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How could i put different values &lt;B&gt;into the same context variable X ? &lt;/B&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 08:37:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-could-use-context-variable-with-OR-clause-in-sql/m-p/2348080#M115249</guid>
      <dc:creator>kakooo16</dc:creator>
      <dc:date>2021-06-14T08:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: How could use context variable with OR clause in sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-could-use-context-variable-with-OR-clause-in-sql/m-p/2348081#M115250</link>
      <description>&lt;P&gt;Hi , &lt;/P&gt;&lt;P&gt;first :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AND &lt;/P&gt;&lt;P&gt;( (&lt;B&gt;context. y&lt;/B&gt;=&lt;/P&gt;&lt;P&gt;'F01'&lt;/P&gt;&lt;P&gt;) &lt;/P&gt;&lt;P&gt;OR &lt;/P&gt;&lt;P&gt;(&lt;B&gt;context.y&lt;/B&gt;=&lt;/P&gt;&lt;P&gt;'CIP'&lt;/P&gt;&lt;P&gt;) &lt;/P&gt;&lt;P&gt;OR &lt;/P&gt;&lt;P&gt;(&lt;B&gt;context.y&lt;/B&gt;=&lt;/P&gt;&lt;P&gt;'T01'&lt;/P&gt;&lt;P&gt;) &lt;/P&gt;&lt;P&gt;OR &lt;/P&gt;&lt;P&gt;(&lt;B&gt;context.y&lt;/B&gt;=&lt;/P&gt;&lt;P&gt;'U01'&lt;/P&gt;&lt;P&gt;) &lt;/P&gt;&lt;P&gt;OR &lt;/P&gt;&lt;P&gt;(&lt;B&gt;context.y&lt;/B&gt;=&lt;/P&gt;&lt;P&gt;'L01' &lt;/P&gt;&lt;P&gt;)) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;gt; AND context.y in ('F01','CIP','T01','U01','L01' )&lt;/P&gt;&lt;P&gt;second :&lt;/P&gt;&lt;P&gt;If you want multiple values you can separate your values by a delimiter in you context variable ex : "900;800;700;600"&lt;/P&gt;&lt;P&gt;then you use a tnormalize with ; as separator on this value,&lt;/P&gt;&lt;P&gt;then you iterate with a tflowtoiterate and you use the globalMap value of the field of the tflowtoiterate in your query.&lt;/P&gt;&lt;P&gt;Send me Love and Kudos&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 08:46:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-could-use-context-variable-with-OR-clause-in-sql/m-p/2348081#M115250</guid>
      <dc:creator>gjeremy1617088143</dc:creator>
      <dc:date>2021-06-14T08:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: How could use context variable with OR clause in sql</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-could-use-context-variable-with-OR-clause-in-sql/m-p/2348082#M115251</link>
      <description>&lt;P&gt;The query looks like:&lt;/P&gt;&lt;P&gt;"Select x,y,z from tablename where x=“+context.x+" and y in "+context.y&lt;/P&gt;&lt;P&gt;before executing the query, you can set the value of context variable on tJava/tJavaFlex component, eg:&lt;/P&gt;&lt;P&gt;...tJava--onComponentOK--tMysqlInput--main--...&lt;/P&gt;&lt;P&gt;on tJava:&lt;/P&gt;&lt;P&gt;context.x="900";&lt;/P&gt;&lt;P&gt;context.y="('T01','U01','D01')";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 02:37:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-could-use-context-variable-with-OR-clause-in-sql/m-p/2348082#M115251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-15T02:37:52Z</dc:date>
    </item>
  </channel>
</rss>

