<?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 Need to ignore missing SQL tables on reload of data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143348#M22607</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;BR /&gt;&lt;BR /&gt;Thanks for the tip about putting the code on a wiki - but I am sure there are more elegant solutions. Feel free to post the code elsewhere though if you wish.&lt;BR /&gt;&lt;BR /&gt;It's worth noting that the second instance of setting the error mode back to 1 is better off after the drop - as the temporary table is not created if none of the tables being checked for in that way are referenced. In the scenario I am using the code it is an either one table or the other situation - so it makes little difference.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 May 2009 04:34:58 GMT</pubDate>
    <dc:creator>stevedark</dc:creator>
    <dc:date>2009-05-06T04:34:58Z</dc:date>
    <item>
      <title>Need to ignore missing SQL tables on reload of data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143343#M22602</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 am producing a QlikView document that I wish to point to many different servers with similar but not identical data layouts. I wish to have the complete set of tables that I may wish to pull in in the script - but the script to ignore tables that are not there.&lt;/P&gt;&lt;P&gt;Happy to poll the sysdatabases and sysobjects tables to find if the tables exist - but I don't know how to then do a conditional statement around the load of the missing table.&lt;/P&gt;&lt;P&gt;Would even be equally happy with just putting an 'on error' / 'try catch' type construct around that table - but I am not sure if one of those exists.&lt;/P&gt;&lt;P&gt;Obviously the desired result could be achieved by commenting parts of the script when pointing to different servers, but I would rather not have users having to do that.&lt;/P&gt;&lt;P&gt;Many thanks in advance for any pointers you can give me.&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 17:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143343#M22602</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2009-05-05T17:07:01Z</dc:date>
    </item>
    <item>
      <title>Need to ignore missing SQL tables on reload of data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143344#M22603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steve,&lt;BR /&gt;I think what you're looking for is the &lt;STRONG&gt;ErrorMode&lt;/STRONG&gt;. See online help on this topic, I'm sure you'll figure out how to use it.&lt;BR /&gt;The simple way is to use &lt;STRONG&gt;ErrorMode=0&lt;/STRONG&gt;, but you can do much more with it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 19:27:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143344#M22603</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-05-05T19:27:35Z</dc:date>
    </item>
    <item>
      <title>Need to ignore missing SQL tables on reload of data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143345#M22604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Search the On-line Help for an article "Error Variables" between ErrorMode and ScriptError, you can construct syntax similar to try... catch - there is a nice example there.&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;Oleg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 19:28:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143345#M22604</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-05-05T19:28:47Z</dc:date>
    </item>
    <item>
      <title>Need to ignore missing SQL tables on reload of data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143346#M22605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys for the quick response. After your pointers the finished chunk of code looks like this:&lt;/P&gt;&lt;P&gt;set ErrorMode=0;&lt;BR /&gt;ErrorTemp:&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM DBName.dbo.tbl_ErrorCode&lt;BR /&gt;WHERE 0 = 1;&lt;/P&gt;&lt;P&gt;if ScriptError &amp;lt;&amp;gt; 4 and ScriptError &amp;lt;&amp;gt; 5 then&lt;BR /&gt; set ErrorMode = 1;&lt;BR /&gt; ErrorCode:&lt;BR /&gt; LOAD ErrorCode as ErrorCodeId,&lt;BR /&gt; ErrorDesc as ErrorMessage;&lt;BR /&gt; SQL SELECT *&lt;BR /&gt; FROM DBName.dbo.tbl_ErrorCode;&lt;BR /&gt;end if&lt;/P&gt;&lt;P&gt;set ErrorMode = 1;&lt;BR /&gt;drop table ErrorTemp;&lt;/P&gt;&lt;P&gt;I don't tend to like relying on turning off error trapping - it is there for a reason after all, but using the first query to check for a specific couple of error conditions before retrying means that it won't skip over a table because of a mistyped field name.&lt;BR /&gt;&lt;BR /&gt;I guess this could be re-written to use a select from sysdatabases and sysobjects, and then take a 'peek' at the data - but this solution does me fine for the demo I am putting together.&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Steve&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 May 2009 19:52:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143346#M22605</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2009-05-05T19:52:52Z</dc:date>
    </item>
    <item>
      <title>Need to ignore missing SQL tables on reload of data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143347#M22606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steve,&lt;/P&gt;&lt;P&gt;Useful bit of code.&lt;/P&gt;&lt;P&gt;How about writing this up as a wiki page?&lt;BR /&gt;&lt;A href="http://community.qlik.com/wikis/qlikview-wiki/default.aspx"&gt;http://community.qlik.com/wikis/qlikview-wiki/default.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 00:09:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143347#M22606</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-05-06T00:09:25Z</dc:date>
    </item>
    <item>
      <title>Need to ignore missing SQL tables on reload of data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143348#M22607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;BR /&gt;&lt;BR /&gt;Thanks for the tip about putting the code on a wiki - but I am sure there are more elegant solutions. Feel free to post the code elsewhere though if you wish.&lt;BR /&gt;&lt;BR /&gt;It's worth noting that the second instance of setting the error mode back to 1 is better off after the drop - as the temporary table is not created if none of the tables being checked for in that way are referenced. In the scenario I am using the code it is an either one table or the other situation - so it makes little difference.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 04:34:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143348#M22607</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2009-05-06T04:34:58Z</dc:date>
    </item>
    <item>
      <title>Need to ignore missing SQL tables on reload of data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143349#M22608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hullo,&lt;BR /&gt;&lt;BR /&gt;The error trap suggested above worked fine, and following the motto 'if it ain't broke' I have run with it for some time. However, as soon as I tried to get Publisher to do a reload with the error trap in place it failed - seemingly ignoring the fact that I was instructing it to ignore errors.&lt;BR /&gt;&lt;BR /&gt;I have therefore coded it with a reference to Sysdatabases, and it works a treat:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Sysdatabases:&lt;BR /&gt;LOAD&lt;BR /&gt; name as DatabaseName;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM master.dbo.sysdatabases;&lt;BR /&gt;let vHasBanking = FieldIndex('DatabaseName', 'ABCBanking');&lt;BR /&gt;&lt;BR /&gt;if vHasBanking &amp;gt; 0 then&lt;BR /&gt; ErrorCode:&lt;BR /&gt; LOAD ErrorCode as ErrorCodeId,&lt;BR /&gt; ErrorDesc as ErrorMessage;&lt;BR /&gt; SQL SELECT *&lt;BR /&gt; FROM ABCBanking.dbo.tbl_ErrorCode;&lt;BR /&gt;end if&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Obviously both developer and publisher user accounts must have read rights to the system tables, and that was already the case in this environment.&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2009 17:36:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-ignore-missing-SQL-tables-on-reload-of-data/m-p/143349#M22608</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2009-07-28T17:36:22Z</dc:date>
    </item>
  </channel>
</rss>

