<?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: Keeping an SQL function in a tDBInput in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Keeping-an-SQL-function-in-a-tDBInput/m-p/2333570#M102342</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to use tMap -&amp;gt; tFlowToIterate -- iterate --&amp;gt; tDBInput&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"select data1&lt;/P&gt;&lt;P&gt;from hist690&lt;/P&gt;&lt;P&gt;where hist_datcpt = TO_DATE('&lt;B&gt;"+(  (String)globalMap.get("... use ctrl+Space for this)  )+"&lt;/B&gt;', 'DD/MM/RR')"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the number of records (there's a 2k limit for an IN caluse) you could also do it this way:&lt;/P&gt;&lt;P&gt;tAggregateRow -&amp;gt; concatenate the formatted string dates:&lt;/P&gt;&lt;P&gt;TO_STRING(hist_datcpt, 'DD/MM'RR') IN (  &amp;lt;&amp;lt; list of dates &amp;gt;&amp;gt; )&lt;/P&gt;&lt;P&gt;In case you have more than 2000 dates you can still add a rowNum modulo 1000 to your dataset and submit queries with 1000 items at a time. This latter is more effort to develop but for bigger tables it works better than executing queries one by one.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Nov 2022 15:57:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-11-17T15:57:48Z</dc:date>
    <item>
      <title>Keeping an SQL function in a tDBInput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Keeping-an-SQL-function-in-a-tDBInput/m-p/2333567#M102339</link>
      <description>&lt;P&gt;Hello, I would like to know if it is possible to keep a SQL function in the syntax of a tDBInput. For example :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"select data1&lt;/P&gt;&lt;P&gt;from hist690 &lt;/P&gt;&lt;P&gt;where hist_datcpt = TO_DATE('&lt;B&gt;value_from_tmap&lt;/B&gt;', 'DD/MM/RR')"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inside the function, this is a value that I inject from my tMap. Is this possible? If not, do you have an alternative?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 22:21:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Keeping-an-SQL-function-in-a-tDBInput/m-p/2333567#M102339</guid>
      <dc:creator>stephbzr</dc:creator>
      <dc:date>2024-11-15T22:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an SQL function in a tDBInput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Keeping-an-SQL-function-in-a-tDBInput/m-p/2333568#M102340</link>
      <description>&lt;P&gt;it's impossible to do so.&lt;/P&gt;&lt;P&gt;as instead, you can define a job &lt;B&gt;context variable&lt;/B&gt; (e.g. date1) , setup the value for context variable in tJavaRow after the tMap component, then use it in the tDBInput query like&lt;/P&gt;&lt;P&gt;"select data1&lt;/P&gt;&lt;P&gt;from hist690&lt;/P&gt;&lt;P&gt;where hist_datcpt = TO_DATE('"+ &lt;B&gt;context.date1&lt;/B&gt;+"', 'DD/MM/RR')"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is an example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000Z20eUAAR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144109i12761253DDA7268C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000Z20eUAAR.png" alt="0695b00000Z20eUAAR.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 02:45:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Keeping-an-SQL-function-in-a-tDBInput/m-p/2333568#M102340</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-17T02:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an SQL function in a tDBInput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Keeping-an-SQL-function-in-a-tDBInput/m-p/2333569#M102341</link>
      <description>&lt;P&gt;Hello @Aiming Chen​&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for this very interesting method, but my value for the context variable varies for each input row of the tMap (the rows come from an Excel file). Will the method work? If not, how can I do it?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 10:32:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Keeping-an-SQL-function-in-a-tDBInput/m-p/2333569#M102341</guid>
      <dc:creator>stephbzr</dc:creator>
      <dc:date>2022-11-17T10:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an SQL function in a tDBInput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Keeping-an-SQL-function-in-a-tDBInput/m-p/2333570#M102342</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to use tMap -&amp;gt; tFlowToIterate -- iterate --&amp;gt; tDBInput&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"select data1&lt;/P&gt;&lt;P&gt;from hist690&lt;/P&gt;&lt;P&gt;where hist_datcpt = TO_DATE('&lt;B&gt;"+(  (String)globalMap.get("... use ctrl+Space for this)  )+"&lt;/B&gt;', 'DD/MM/RR')"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the number of records (there's a 2k limit for an IN caluse) you could also do it this way:&lt;/P&gt;&lt;P&gt;tAggregateRow -&amp;gt; concatenate the formatted string dates:&lt;/P&gt;&lt;P&gt;TO_STRING(hist_datcpt, 'DD/MM'RR') IN (  &amp;lt;&amp;lt; list of dates &amp;gt;&amp;gt; )&lt;/P&gt;&lt;P&gt;In case you have more than 2000 dates you can still add a rowNum modulo 1000 to your dataset and submit queries with 1000 items at a time. This latter is more effort to develop but for bigger tables it works better than executing queries one by one.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 15:57:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Keeping-an-SQL-function-in-a-tDBInput/m-p/2333570#M102342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-17T15:57:48Z</dc:date>
    </item>
  </channel>
</rss>

