<?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 to pass a variable in a tMSSQLInput based on a query ? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291805#M64941</link>
    <description>Java : 
&lt;BR /&gt;"SELECT * from TABLE
&lt;BR /&gt;where S.CODE_PER IN ('2007070','2007080','2007090') " 
&lt;BR /&gt;I need to pass ('2007070','2007080','2007090') as a variable : current month, month -1 and month -2 as YYYYMM0</description>
    <pubDate>Thu, 06 Sep 2007 13:53:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-09-06T13:53:23Z</dc:date>
    <item>
      <title>how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291803#M64939</link>
      <description>hello 
&lt;BR /&gt;I would like to use one SQL query that could vary based upon one variable, how can I pass this parameter in the SQL query ? 
&lt;BR /&gt;David</description>
      <pubDate>Sat, 16 Nov 2024 14:33:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291803#M64939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291804#M64940</link>
      <description>Perl or Java project?</description>
      <pubDate>Thu, 06 Sep 2007 13:50:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291804#M64940</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-06T13:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291805#M64941</link>
      <description>Java : 
&lt;BR /&gt;"SELECT * from TABLE
&lt;BR /&gt;where S.CODE_PER IN ('2007070','2007080','2007090') " 
&lt;BR /&gt;I need to pass ('2007070','2007080','2007090') as a variable : current month, month -1 and month -2 as YYYYMM0</description>
      <pubDate>Thu, 06 Sep 2007 13:53:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291805#M64941</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-06T13:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291806#M64942</link>
      <description>Hi dcopp.&lt;BR /&gt;Try this (I've discover it today): &lt;BR /&gt;"SELECT * from TABLE&lt;BR /&gt;where   S.CODE_PER IN ('"+context.getProperty("date")+"',ecc) " &lt;BR /&gt;Bye</description>
      <pubDate>Fri, 07 Sep 2007 12:20:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291806#M64942</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2007-09-07T12:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291807#M64943</link>
      <description>hello
&lt;BR /&gt;How did you define your context ?
&lt;BR /&gt;I don't get any rows with such script, more the 'ecc' column is unknown to me
&lt;BR /&gt;Anybody succeeded in passing a variable value into a SQL script ?</description>
      <pubDate>Fri, 07 Sep 2007 15:43:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291807#M64943</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-07T15:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291808#M64944</link>
      <description>Under tab "Repository" there is an icon called "Contexts". Right click-&amp;gt;create context&lt;BR /&gt;Bye</description>
      <pubDate>Fri, 07 Sep 2007 19:38:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291808#M64944</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-07T19:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291809#M64945</link>
      <description>dcopp,&lt;BR /&gt;All my queries use context variables with MSSQL - have a look at my post 1164.  The screen print will show you how to use context variables with in a query.  As long as the query resolves to a string, that's all that matters.&lt;BR /&gt;Can I also be so bold as to suggest to read the User Guide?  Contexts are clearly documented in there, as are creation of context variables.&lt;BR /&gt;Cheers,&lt;BR /&gt;c0utta</description>
      <pubDate>Mon, 10 Sep 2007 02:37:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291809#M64945</guid>
      <dc:creator>c0utta</dc:creator>
      <dc:date>2007-09-10T02:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291810#M64946</link>
      <description>Ok, I have tried to find the answer in many places in this forum but I haven't been successful.
&lt;BR /&gt;I have two table: one with the unique keys and a second with the associated values. 
&lt;BR /&gt;So I use a first tMysqlInput to get the keys (select id from id_table) --&amp;gt; Iterate --&amp;gt; tMysqlInput (select data from data_table where data_id = tMysqlInput.id)
&lt;BR /&gt;My issue is that I don't know how to iterate on the id result from the first query and use the query result as a parameter in the second component.</description>
      <pubDate>Tue, 19 Aug 2008 01:39:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291810#M64946</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-19T01:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291811#M64947</link>
      <description>Hello raton
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;So I use a first tMysqlInput to get the keys (select id from id_table) --&amp;gt; Iterate --&amp;gt; tMysqlInput (select data from data_table where data_id = tMysqlInput.id)&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;For example:
&lt;BR /&gt;tMysqlInput--row1--&amp;gt;tLogRow
&lt;BR /&gt; |
&lt;BR /&gt; iterate
&lt;BR /&gt; |
&lt;BR /&gt;tMySQLInput("select data from data_table where data_id ="+String.valueOf(row1.id))
&lt;BR /&gt;Best regards
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Tue, 19 Aug 2008 06:02:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291811#M64947</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-19T06:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291812#M64948</link>
      <description>I can feel that I am getting a lot closer to the solution. 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;The equivalent of that line "tMySQLInput("select data from data_table where data_id ="+String.valueOf(row1.id)) " for Perl would be ... ?? 
&lt;BR /&gt;(sorry for the extra question, I just saw this topic was tagged "java" ... )</description>
      <pubDate>Wed, 20 Aug 2008 01:54:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291812#M64948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-20T01:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291813#M64949</link>
      <description>I have had many unsuccessful attempts: 
&lt;BR /&gt;"select data from data_table where data_id = " + $row1 
&lt;BR /&gt;"select data from data_table where data_id = " . $row1 
&lt;BR /&gt;"select data from data_table where data_id = " + $row1.id 
&lt;BR /&gt;"select data from data_table where data_id = " + $row1.id 
&lt;BR /&gt;Then I had the epiphany: 
&lt;BR /&gt;"select data from data_table where data_id = " . $$row1 
&lt;BR /&gt;I thought I would post this as I hope I am not the only person not using Java. 
&lt;BR /&gt;Thanks shong for putting me on the right track 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 20 Aug 2008 22:32:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291813#M64949</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-08-20T22:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291814#M64950</link>
      <description>hi, i can't move in some urgent project.can somebody help me? 
&lt;BR /&gt;i want to pass the parameter in a subquery. how to do it unsing context?</description>
      <pubDate>Tue, 07 Oct 2008 04:13:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291814#M64950</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2008-10-07T04:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291815#M64951</link>
      <description>Isn't your question answered by this thread? &lt;BR /&gt;What else do you want to know or what is you actual problem?</description>
      <pubDate>Tue, 07 Oct 2008 06:06:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291815#M64951</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-10-07T06:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291816#M64952</link>
      <description>my problem is inside the sub query i have to pass the context variable and it is not detecting.</description>
      <pubDate>Tue, 07 Oct 2008 06:38:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291816#M64952</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2008-10-07T06:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291817#M64953</link>
      <description>Can you post the query you are trying to use?</description>
      <pubDate>Tue, 07 Oct 2008 06:39:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291817#M64953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-10-07T06:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291818#M64954</link>
      <description>select distinct uthip.current_status_history.tester,uthip.current_status_history.device,
&lt;BR /&gt;uthip.current_status_history.lotnumber,uthip.current_status_history.tester_status,
&lt;BR /&gt;((select distinct uthip.current_status_history.total_units from uthip.current_status_history where 
&lt;BR /&gt;uthip.current_status_history.tester='\"+(String)globalMap.get(context.tester)+\"'
&lt;BR /&gt;and uthip.current_status_history.datetime_start &amp;lt; (timestamptz(date(text(now())) - 1)+'08:00:00')
&lt;BR /&gt;and uthip.current_status_history.datetime between (timestamptz(date(text(now())) - 1)+'08:00:00')and 
&lt;BR /&gt;(now()) and uthip.current_status_history.datetime =(select max(uthip.current_status_history.datetime) 
&lt;BR /&gt;from uthip.current_status_history where uthip.current_status_history.tester='\"+(String)globalMap.get(context.tester)+\"'
&lt;BR /&gt;and uthip.current_status_history.datetime_start &amp;lt; (timestamptz(date(text(now())) - 1)+'08:00:00')and 
&lt;BR /&gt;uthip.current_status_history.datetime between (timestamptz(date(text(now())) - 1)+'08:00:00')and (now()) ))
&lt;BR /&gt;- 
&lt;BR /&gt;(select distinct uthip.current_status_history.total_units from uthip.current_status_history 
&lt;BR /&gt;where uthip.current_status_history.tester='\"+(String)globalMap.get(context.tester)+\"'
&lt;BR /&gt;and uthip.current_status_history.datetime_start &amp;lt; (timestamptz(date(text(now())) - 1)+'08:00:00')and 
&lt;BR /&gt;uthip.current_status_history.datetime between (timestamptz(date(text(now())) - 1)+'08:00:00')and 
&lt;BR /&gt;(now())and uthip.current_status_history.datetime =(select 
&lt;BR /&gt;min(uthip.current_status_history.datetime) from uthip.current_status_history where 
&lt;BR /&gt;uthip.current_status_history.tester='\"+(String)globalMap.get(context.tester)+\"'
&lt;BR /&gt;and uthip.current_status_history.datetime_start &amp;lt; (timestamptz(date(text(now())) - 1)+'08:00:00')
&lt;BR /&gt;and uthip.current_status_history.datetime between (timestamptz(date(text(now())) - 1)+'08:00:00')and (now())))) 
&lt;BR /&gt;as total_units
&lt;BR /&gt;from uthip.current_status_history where uthip.current_status_history.tester='\"+(String)globalMap.get(context.tester)+\"' and 
&lt;BR /&gt;uthip.current_status_history.datetime_start &amp;lt; (timestamptz(date(text(now())) - 1)+'08:00:00')
&lt;BR /&gt;and uthip.current_status_history.datetime between (timestamptz(date(text(now())) - 1)+'08:00:00')and (now())
&lt;BR /&gt;
&lt;BR /&gt;this is the query
&lt;BR /&gt;1: "select distinct uthip.current_status_history.tester,uthip.current_status_history.device,
&lt;BR /&gt;uthip.current_status_history.lotnumber,uthip.current_status_history.tester_status,"
&lt;BR /&gt;from this section,it is giving correct value.
&lt;BR /&gt;2:from uthip.current_status_history where uthip.current_status_history.tester='\"+(String)globalMap.get(context.tester)+\"' and 
&lt;BR /&gt;uthip.current_status_history.datetime_start &amp;lt; (timestamptz(date(text(now())) - 1)+'08:00:00')
&lt;BR /&gt;and uthip.current_status_history.datetime between (timestamptz(date(text(now())) - 1)+'08:00:00')and (now())
&lt;BR /&gt;from this section also giving correct value.
&lt;BR /&gt;3: but from the middle section it can't detect the variable. but the query is correct and i have tested it.</description>
      <pubDate>Tue, 07 Oct 2008 06:53:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291818#M64954</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2008-10-07T06:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291819#M64955</link>
      <description>I think you do not need the global.map.&lt;BR /&gt;Please change your code to:&lt;BR /&gt;&lt;PRE&gt;//Old code&lt;BR /&gt;(String)globalMap.get(context.tester)&lt;BR /&gt;//New code&lt;BR /&gt;(String) context.tester&lt;BR /&gt;// Additional I think you do not need the (String) conversion. But I'm not sure in this point.&lt;/PRE&gt;&lt;BR /&gt;Bye&lt;BR /&gt;Volker</description>
      <pubDate>Tue, 07 Oct 2008 07:00:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291819#M64955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-10-07T07:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291820#M64956</link>
      <description>thanks a lot,it is working</description>
      <pubDate>Tue, 07 Oct 2008 07:07:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291820#M64956</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2008-10-07T07:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291821#M64957</link>
      <description>You are welcome.
&lt;BR /&gt;By the way (and for everyone which will have the same problem in the future): globalMap is a hash variable which stores different information of the components (like the fileName of a tFileList for example). If you use a tFlowToIterate the row itself will be stored in the globalMap. The context is a dedicated variable which is not stored in the hash so you can just use it.
&lt;BR /&gt;Bye
&lt;BR /&gt;Volker</description>
      <pubDate>Tue, 07 Oct 2008 07:17:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291821#M64957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-10-07T07:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass a variable in a tMSSQLInput based on a query ?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291822#M64958</link>
      <description>Hi, can i pass a object to the sub job? if can, then to do it?</description>
      <pubDate>Wed, 08 Oct 2008 07:07:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/how-to-pass-a-variable-in-a-tMSSQLInput-based-on-a-query/m-p/2291822#M64958</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2008-10-08T07:07:58Z</dc:date>
    </item>
  </channel>
</rss>

