<?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 Script - Use results of first SQL in subsequent SQL in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-Use-results-of-first-SQL-in-subsequent-SQL/m-p/1377106#M808737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, my script has about 10 SQL statements.&amp;nbsp; All are very similar pulling different attributes from an oracle db.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each SQL state has a where clause along the lines of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE fieldname IN (SELECT FIELD FROM TABLE WHERE STATUS = 1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the embedded Select statement in each where clause is of course quite ineffective.&amp;nbsp; Can I run that SQL statement first and then use the results in the subsequent SQL statements in order to speed up the overall load?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>reddwarfcrew</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Script - Use results of first SQL in subsequent SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Use-results-of-first-SQL-in-subsequent-SQL/m-p/1377106#M808737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, my script has about 10 SQL statements.&amp;nbsp; All are very similar pulling different attributes from an oracle db.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each SQL state has a where clause along the lines of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE fieldname IN (SELECT FIELD FROM TABLE WHERE STATUS = 1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the embedded Select statement in each where clause is of course quite ineffective.&amp;nbsp; Can I run that SQL statement first and then use the results in the subsequent SQL statements in order to speed up the overall load?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Use-results-of-first-SQL-in-subsequent-SQL/m-p/1377106#M808737</guid>
      <dc:creator>reddwarfcrew</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Use results of first SQL in subsequent SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Use-results-of-first-SQL-in-subsequent-SQL/m-p/1377107#M808738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this may be it will work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1:SELECT FIELD FROM TABLE WHERE STATUS = 1&lt;/P&gt;&lt;P&gt;2: use peek and concat to store all the value of field in a variable and make sure they are separated by comma(,) &lt;/P&gt;&lt;P&gt;3:use variable in plave of SELECT FIELD FROM TABLE WHERE STATUS = 1in the where clause&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 20:39:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Use-results-of-first-SQL-in-subsequent-SQL/m-p/1377107#M808738</guid>
      <dc:creator>pradosh_thakur</dc:creator>
      <dc:date>2017-10-16T20:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Use results of first SQL in subsequent SQL</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Use-results-of-first-SQL-in-subsequent-SQL/m-p/1377108#M808739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is a limit, 1000 if I remember, for the number of elements in a IN Oracle clause, so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will always works&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;WHERE fieldname IN (SELECT FIELD FROM TABLE WHERE STATUS = 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;WHERE fieldname IN (1, 2, .......n)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;will work for n &amp;lt;= 1000&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 21:00:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Use-results-of-first-SQL-in-subsequent-SQL/m-p/1377108#M808739</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2017-10-16T21:00:58Z</dc:date>
    </item>
  </channel>
</rss>

