<?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 SQL statement with a cursor in it in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-statement-with-a-cursor-in-it/m-p/209302#M64357</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is an old post I konw but I am curious if you figured this out? Has anyone used cursors in qlikview scripts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Oct 2011 15:28:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-10-24T15:28:12Z</dc:date>
    <item>
      <title>SQL statement with a cursor in it</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-statement-with-a-cursor-in-it/m-p/209301#M64356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I have an SQL Server script that is briefly something as following:&lt;/P&gt;&lt;P&gt;Declare someting ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLE #tempTable&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;DECLARE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;db_cursor CURSOR&lt;/P&gt;&lt;P&gt;FOR&lt;/P&gt;&lt;P&gt;select.....&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;FETCH NEXT FROM db_cursor INTO .....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHILE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@@FETCH_STATUS = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;BEGIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into #tempTable....&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;It is working well in SQL Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When it comes to executing it in QV, I have tried to put a "sql" expression at the beginning and ";" at the and of the QV script. QV does not realize it. For info, I dont have a permission to create a stored procedure in the database.&lt;/P&gt;&lt;P&gt;Any solution? Thanks in advance.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 12:50:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-statement-with-a-cursor-in-it/m-p/209301#M64356</guid>
      <dc:creator />
      <dc:date>2010-09-20T12:50:20Z</dc:date>
    </item>
    <item>
      <title>SQL statement with a cursor in it</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-statement-with-a-cursor-in-it/m-p/209302#M64357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is an old post I konw but I am curious if you figured this out? Has anyone used cursors in qlikview scripts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 15:28:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-statement-with-a-cursor-in-it/m-p/209302#M64357</guid>
      <dc:creator />
      <dc:date>2011-10-24T15:28:12Z</dc:date>
    </item>
    <item>
      <title>SQL statement with a cursor in it</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-statement-with-a-cursor-in-it/m-p/209303#M64358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; putting any complicated SQL inside an exec usually does the trick...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exec ('&amp;nbsp;&amp;nbsp;&amp;nbsp; T-SQL&amp;nbsp;&amp;nbsp; ')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to double any quotes inside the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2012 20:14:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-statement-with-a-cursor-in-it/m-p/209303#M64358</guid>
      <dc:creator />
      <dc:date>2012-02-06T20:14:01Z</dc:date>
    </item>
  </channel>
</rss>

