<?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 tDBInput and Select where in - from Hashmap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tDBInput-and-Select-where-in-from-Hashmap/m-p/2420328#M140168</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;i have a hashmap with one Column CustomerID and maximum of 50-80 records. (from a XLSx)&lt;/P&gt;
&lt;P&gt;CustomerID&lt;BR /&gt;123&lt;BR /&gt;456&lt;BR /&gt;122&lt;BR /&gt;..&lt;/P&gt;
&lt;P&gt;Now i want to use this values from the Hashmap in a "where in" Subselect Statement in the tDBInput Component&lt;/P&gt;
&lt;P&gt;like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;select * from orders where order_customerID in (Select customerid from &lt;EM&gt;tHashmap&lt;/EM&gt;)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Why i will do this that way ?&lt;BR /&gt;I except more Performance when i will use this Query.&lt;BR /&gt;The background is that the table orders has over 8 Millions records. A tMap is very slow because it reads all the 8 Millions Records from the Orders Table&lt;BR /&gt;&lt;BR /&gt;Also i have no write rights to create a temporary table on the source system. If i had, i would a temporary table on the source system. But that is not possible.&lt;/P&gt;
&lt;P&gt;How can i do this in Talend ? I read many Issues but nothing which helped me.&lt;/P&gt;
&lt;P&gt;/Chris&lt;/P&gt;</description>
    <pubDate>Sat, 17 Feb 2024 15:10:25 GMT</pubDate>
    <dc:creator>linguin</dc:creator>
    <dc:date>2024-02-17T15:10:25Z</dc:date>
    <item>
      <title>tDBInput and Select where in - from Hashmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDBInput-and-Select-where-in-from-Hashmap/m-p/2420328#M140168</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;i have a hashmap with one Column CustomerID and maximum of 50-80 records. (from a XLSx)&lt;/P&gt;
&lt;P&gt;CustomerID&lt;BR /&gt;123&lt;BR /&gt;456&lt;BR /&gt;122&lt;BR /&gt;..&lt;/P&gt;
&lt;P&gt;Now i want to use this values from the Hashmap in a "where in" Subselect Statement in the tDBInput Component&lt;/P&gt;
&lt;P&gt;like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;select * from orders where order_customerID in (Select customerid from &lt;EM&gt;tHashmap&lt;/EM&gt;)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Why i will do this that way ?&lt;BR /&gt;I except more Performance when i will use this Query.&lt;BR /&gt;The background is that the table orders has over 8 Millions records. A tMap is very slow because it reads all the 8 Millions Records from the Orders Table&lt;BR /&gt;&lt;BR /&gt;Also i have no write rights to create a temporary table on the source system. If i had, i would a temporary table on the source system. But that is not possible.&lt;/P&gt;
&lt;P&gt;How can i do this in Talend ? I read many Issues but nothing which helped me.&lt;/P&gt;
&lt;P&gt;/Chris&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 15:10:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDBInput-and-Select-where-in-from-Hashmap/m-p/2420328#M140168</guid>
      <dc:creator>linguin</dc:creator>
      <dc:date>2024-02-17T15:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: tDBInput and Select where in - from Hashmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDBInput-and-Select-where-in-from-Hashmap/m-p/2420460#M140176</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can read the customerID from XLSX and build the customerID string like this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;123,456,122&lt;/SPAN&gt;&lt;BR /&gt;the CustomerID string will be used in the query as &lt;STRONG&gt;in&lt;/STRONG&gt; values.&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;tFileInputExcel--main--tJavaFlex&lt;/P&gt;
&lt;P&gt;|onsubjobok&lt;/P&gt;
&lt;P&gt;tDBInput&lt;/P&gt;
&lt;P&gt;on tJavaFlex component:&lt;/P&gt;
&lt;P&gt;Start code:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt; String inStr="";&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Main code:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;if(inStr.equals("")){&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;inStr=row4.customerID;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}else{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;inStr=inStr+","+row4.customerID;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;End code:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;globalMap.put("key", inStr);&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;on tDBInput component, write the query like this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;"select * from orders where order_customerID in ("+(String)globalMap.get("key")+")"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Hope it helps you!&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Shicong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 02:20:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDBInput-and-Select-where-in-from-Hashmap/m-p/2420460#M140176</guid>
      <dc:creator>Shicong_Hong</dc:creator>
      <dc:date>2024-02-19T02:20:05Z</dc:date>
    </item>
  </channel>
</rss>

