<?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: With CTE SQl query resulting error on schedule reload. mannually its running in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795108#M1039869</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: sans-serif; background-color: #ebffe6;"&gt;Try to place a semicolon ; just before the WITH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: sans-serif; background-color: #ebffe6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL &lt;STRONG&gt;;&lt;/STRONG&gt;WITH CTE(x,y,z,) AS&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;( SELECT *&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;From table&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Inner Join&amp;nbsp; ...........................................&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Left Outer Join&amp;nbsp; .........................&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Left Outer Join ...........................)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SELECT * FROM CTE WHERE ..................................);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: sans-serif; background-color: #ebffe6;"&gt;&lt;EM&gt;&lt;STRONG&gt;The semicolon is needed for scenarios where WITH could be considered part of the previous query&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: sans-serif; background-color: #ebffe6;"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: sans-serif; background-color: #ebffe6;"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Dec 2014 04:56:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-12-29T04:56:05Z</dc:date>
    <item>
      <title>With CTE SQl query resulting error on schedule reload. mannually its running</title>
      <link>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795107#M1039868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;With CTE&lt;/STRONG&gt; SQl query resulting error on schedule reload. mannually its running&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL WITH CTE(x,y,z,) AS &lt;/P&gt;&lt;P&gt;( SELECT *&lt;/P&gt;&lt;P&gt;From table&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Inner Join&amp;nbsp; ...........................................&lt;/P&gt;&lt;P&gt;Left Outer Join&amp;nbsp; .........................&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Left Outer Join ...........................)&lt;/P&gt;&lt;P&gt;SELECT * FROM CTE WHERE ..................................);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this query running mannually. but on schedule realod its saying below erro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; Error: ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: Incorrect syntax near the keyword 'WITH'.&lt;/P&gt;&lt;P&gt;29/12/2014 04:30:55:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; General Script Error&lt;/P&gt;&lt;P&gt;29/12/2014 04:30:55:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Execution Failed&lt;/P&gt;&lt;P&gt;29/12/2014 04:30:55:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Execution finished.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 04:39:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795107#M1039868</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2014-12-29T04:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: With CTE SQl query resulting error on schedule reload. mannually its running</title>
      <link>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795108#M1039869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: sans-serif; background-color: #ebffe6;"&gt;Try to place a semicolon ; just before the WITH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: sans-serif; background-color: #ebffe6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL &lt;STRONG&gt;;&lt;/STRONG&gt;WITH CTE(x,y,z,) AS&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;( SELECT *&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;From table&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Inner Join&amp;nbsp; ...........................................&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Left Outer Join&amp;nbsp; .........................&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Left Outer Join ...........................)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SELECT * FROM CTE WHERE ..................................);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: sans-serif; background-color: #ebffe6;"&gt;&lt;EM&gt;&lt;STRONG&gt;The semicolon is needed for scenarios where WITH could be considered part of the previous query&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: sans-serif; background-color: #ebffe6;"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: sans-serif; background-color: #ebffe6;"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 04:56:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795108#M1039869</guid>
      <dc:creator />
      <dc:date>2014-12-29T04:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: With CTE SQl query resulting error on schedule reload. mannually its running</title>
      <link>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795109#M1039870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not working &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 04:59:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795109#M1039870</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2014-12-29T04:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: With CTE SQl query resulting error on schedule reload. mannually its running</title>
      <link>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795110#M1039871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As WITH CTE is native to MSSqlServer, I am not sure Qview supports it 100%. For instance the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WITH backup_details(name,backup_type) AS&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SELECT name,backup_type from dbo.Backup_History WHERE Server='MYTESTSERVER'&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;SELECT&amp;nbsp; * from backup_details where backup_type='Database'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should be replaced in Qlikview as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT name,backup_type from dbo.Backup_History WHERE Sever="MYTESTSERVER'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND backup_type = 'Database'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CTE&lt;/STRONG&gt; are just like temporary (more cmplex tought when they are recursive ones) Views where you can simply your select from. Otherwise you can go and create a VIEW as CREATE VIEW backup_details as SELECT name,backup_type from dbo.Backup_History WHERE Server='MYTESTSERVER' and then select from View in QlikView.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 05:01:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795110#M1039871</guid>
      <dc:creator />
      <dc:date>2014-12-29T05:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: With CTE SQl query resulting error on schedule reload. mannually its running</title>
      <link>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795111#M1039872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i had this idea in mind . but i thought to run thi without disturbing DBA &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 05:03:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795111#M1039872</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2014-12-29T05:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: With CTE SQl query resulting error on schedule reload. mannually its running</title>
      <link>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795112#M1039873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had a similar issue but found using stored procedures a good way to get around this.&lt;/P&gt;&lt;P&gt;Just move the logic in your SQL to a stored procedure and run as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;exec &amp;lt;&amp;lt;enter stored procedure name here&amp;gt;&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tries using the following and it did not error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL &lt;/P&gt;&lt;P&gt;with Data&lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp; select * from dbo.Dim_Store&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;&amp;nbsp; a.*&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp; Data a;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only difference i can see is i did not define the field names in the first part of the CTE.&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spud&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 05:18:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795112#M1039873</guid>
      <dc:creator />
      <dc:date>2014-12-29T05:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: With CTE SQl query resulting error on schedule reload. mannually its running</title>
      <link>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795113#M1039874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What if you put the CTE and that load in a Macro invoked from the Load script as follows;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SunilCTE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then SunilCTE sub contains the CTE part as a native sql query as follows:&lt;/P&gt;&lt;P&gt;Sub SunilCTE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set objADO = CreateObject(“ADODB.Connection”)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;‘Establish a connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objADO.Open “Provider=put your provider her etcetc;Data Source=yourDB;User ID=youruseretcetc;Password=Passkey;”&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;strSQL=”WITH CTE(x,y,z,) AS&lt;/P&gt;&lt;P&gt;( SELECT *&lt;/P&gt;&lt;P&gt;From table &lt;/P&gt;&lt;P&gt;Inner Join&amp;nbsp; ...........................................&lt;/P&gt;&lt;P&gt;Left Outer Join&amp;nbsp; .........................&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Left Outer Join ...........................)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;objADO.Execute strSQL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//regular QlikView load sintax here from now on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM CTE WHERE ..................................);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end Sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 05:22:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795113#M1039874</guid>
      <dc:creator />
      <dc:date>2014-12-29T05:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: With CTE SQl query resulting error on schedule reload. mannually its running</title>
      <link>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795114#M1039875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Mario. i think its really good way to do this.&lt;/P&gt;&lt;P&gt;But My bad we are not using macro anywhere in applications.&lt;/P&gt;&lt;P&gt;could you please provide how to execute this query itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know i will have to go finally for stored procedure view or select query. but i am looking there should be a way to excute this CTE query itself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 05:33:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795114#M1039875</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2014-12-29T05:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: With CTE SQl query resulting error on schedule reload. mannually its running</title>
      <link>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795115#M1039876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any solution for this ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2014 09:54:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/With-CTE-SQl-query-resulting-error-on-schedule-reload-mannually/m-p/795115#M1039876</guid>
      <dc:creator>SunilChauhan</dc:creator>
      <dc:date>2014-12-29T09:54:54Z</dc:date>
    </item>
  </channel>
</rss>

