<?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: Retrieve status of LIB CONNECT TO 'xxx' in Data Load Editor Script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Retrieve-status-of-LIB-CONNECT-TO-xxx-in-Data-Load-Editor-Script/m-p/1590568#M43357</link>
    <description>Florian,&lt;BR /&gt;If you want an example, import one of the supplied monitoring applications. For example, License Monitor. They include code to check for the existence of the Logging Database. You could use this as a sample.&lt;BR /&gt;Set errormode = 0; // suppress reload failure in case of no database&lt;BR /&gt;&lt;BR /&gt;LIB CONNECT TO 'QLogs';&lt;BR /&gt;&lt;BR /&gt;// If there is an error connecting to logging database...&lt;BR /&gt;LET tempErrorDetails = ScriptErrorDetails;&lt;BR /&gt;IF Len(tempErrorDetails) &amp;gt; 0 THEN&lt;BR /&gt;trace ERROR: $(tempErrorDetails);&lt;BR /&gt;CALL monitor_app_reload_stats('WARN','$(textFile)', tempErrorDetails, 'Status Message')&lt;BR /&gt;tempErrorDetails =; // Reset this variable&lt;BR /&gt;TRACE Could not validate active database logging. Sourcing from file logs instead.;&lt;BR /&gt;SET db_v_file = 1;&lt;BR /&gt;LET baseTableName = '$(baseTableName)_file'; // Store log history QVD with suffix _file so it only gets used with file logging&lt;BR /&gt;LET lastReloadCompare = If(LastReloadSource=1,lastReloadCompare,cutoffDate); // If last reload loaded from db and now from file&lt;BR /&gt;// we want to start over and pull data from cutoffdate&lt;BR /&gt;TRACE Last Reload Compare time = $(lastReloadCompare). CutoffDate = $(cutoffDate).;&lt;BR /&gt;SET errormode=1;&lt;BR /&gt;EXIT SUB;</description>
    <pubDate>Tue, 11 Jun 2019 15:21:50 GMT</pubDate>
    <dc:creator>kevincase</dc:creator>
    <dc:date>2019-06-11T15:21:50Z</dc:date>
    <item>
      <title>Retrieve status of LIB CONNECT TO 'xxx' in Data Load Editor Script</title>
      <link>https://community.qlik.com/t5/App-Development/Retrieve-status-of-LIB-CONNECT-TO-xxx-in-Data-Load-Editor-Script/m-p/1590426#M43335</link>
      <description>&lt;P&gt;Hi @all,&lt;/P&gt;&lt;P&gt;I am wondering if it's possible to retrieve the status of a LIB CONNECT TO 'xxx' in the Data Load Editor Script. I need it for:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LIB CONNECT TO 'xxx';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF &amp;lt;status&amp;gt;=error then LIB CONNECT TO 'yyy';&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Florian&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 11:27:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Retrieve-status-of-LIB-CONNECT-TO-xxx-in-Data-Load-Editor-Script/m-p/1590426#M43335</guid>
      <dc:creator>florian_bertsch</dc:creator>
      <dc:date>2019-06-11T11:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve status of LIB CONNECT TO 'xxx' in Data Load Editor Script</title>
      <link>https://community.qlik.com/t5/App-Development/Retrieve-status-of-LIB-CONNECT-TO-xxx-in-Data-Load-Editor-Script/m-p/1590550#M43356</link>
      <description>never tried it. but i would theorize that you need to use error variables.&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/sense/April2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ErrorVariables/ErrorVariables.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/April2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ErrorVariables/ErrorVariables.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;i.e. set errormode=2&lt;BR /&gt;then use ScriptError variable to check and then connect to other db</description>
      <pubDate>Tue, 11 Jun 2019 14:59:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Retrieve-status-of-LIB-CONNECT-TO-xxx-in-Data-Load-Editor-Script/m-p/1590550#M43356</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2019-06-11T14:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve status of LIB CONNECT TO 'xxx' in Data Load Editor Script</title>
      <link>https://community.qlik.com/t5/App-Development/Retrieve-status-of-LIB-CONNECT-TO-xxx-in-Data-Load-Editor-Script/m-p/1590568#M43357</link>
      <description>Florian,&lt;BR /&gt;If you want an example, import one of the supplied monitoring applications. For example, License Monitor. They include code to check for the existence of the Logging Database. You could use this as a sample.&lt;BR /&gt;Set errormode = 0; // suppress reload failure in case of no database&lt;BR /&gt;&lt;BR /&gt;LIB CONNECT TO 'QLogs';&lt;BR /&gt;&lt;BR /&gt;// If there is an error connecting to logging database...&lt;BR /&gt;LET tempErrorDetails = ScriptErrorDetails;&lt;BR /&gt;IF Len(tempErrorDetails) &amp;gt; 0 THEN&lt;BR /&gt;trace ERROR: $(tempErrorDetails);&lt;BR /&gt;CALL monitor_app_reload_stats('WARN','$(textFile)', tempErrorDetails, 'Status Message')&lt;BR /&gt;tempErrorDetails =; // Reset this variable&lt;BR /&gt;TRACE Could not validate active database logging. Sourcing from file logs instead.;&lt;BR /&gt;SET db_v_file = 1;&lt;BR /&gt;LET baseTableName = '$(baseTableName)_file'; // Store log history QVD with suffix _file so it only gets used with file logging&lt;BR /&gt;LET lastReloadCompare = If(LastReloadSource=1,lastReloadCompare,cutoffDate); // If last reload loaded from db and now from file&lt;BR /&gt;// we want to start over and pull data from cutoffdate&lt;BR /&gt;TRACE Last Reload Compare time = $(lastReloadCompare). CutoffDate = $(cutoffDate).;&lt;BR /&gt;SET errormode=1;&lt;BR /&gt;EXIT SUB;</description>
      <pubDate>Tue, 11 Jun 2019 15:21:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Retrieve-status-of-LIB-CONNECT-TO-xxx-in-Data-Load-Editor-Script/m-p/1590568#M43357</guid>
      <dc:creator>kevincase</dc:creator>
      <dc:date>2019-06-11T15:21:50Z</dc:date>
    </item>
  </channel>
</rss>

