{"id":11111,"date":"2020-07-14T10:29:46","date_gmt":"2020-07-14T13:29:46","guid":{"rendered":"http:\/\/kb.elipse.com.br\/en\/?p=11111"},"modified":"2020-07-14T10:29:46","modified_gmt":"2020-07-14T13:29:46","slug":"kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/","title":{"rendered":"KB-108744: Returning Elipse E3&#8217;s active alarms via database."},"content":{"rendered":"<h2><strong>Question:<\/strong><\/h2>\n<p>How can I return the active alarms in <a href=\"https:\/\/www.elipse.com.br\/en\/produto\/elipse-e3\/\" target=\"_blank\" rel=\"noopener noreferrer\">Elipse E3<\/a> via database records?<\/p>\n<h2><strong>Solution:<\/strong><\/h2>\n<p>In order to return the active alarms\u00a0 in Elipse E3 (acknowledged or not), you must execute the following query:<\/p>\n<pre>SELECT * FROM Alarms RIGHT JOIN \r\n(SELECT * FROM (SELECT Min(EventCLSID) AS EventCLSID, SUM(OutTimeDbl) AS OutTimeDbl FROM Alarms\r\nWHERE InTime > DATEADD(hh, -48, GETDATE()) \r\nGROUP BY EventCLSID)tbA \r\nWHERE OutTimeDbl = 0)tbB ON Alarms.EventCLSID = tbB.EventCLSID<\/pre>\n<p>&nbsp;<\/p>\n<p>In the figure below, you can see the query&#8217;s result:<\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-10587 size-full\" src=\"http:\/\/kb.elipse.com.br\/wp-content\/uploads\/2020\/04\/10577\/FAA_SQL01.png\" alt=\"retornar alarmes ativos elipse e3\" width=\"694\" height=\"96\" \/><\/p>\n<p>Now, let&#8217;s see how this happens.<\/p>\n<p>First of all, the first query is used for grouping the CLSIDs from the last 48 hours, and then adding the data from\u00a0 <em>OutTimeDbl <\/em>parameter. That way, we will know all the alarms recorded during this period.<\/p>\n<p>&nbsp;<\/p>\n<pre>SELECT Min(EventCLSID) AS EventCLSID, SUM(OutTimeDbl) AS OutTimeDbl FROM Alarms\r\nWHERE InTime > DATEADD(hh, -48, GETDATE())\r\nGROUP BY EventCLSID\r\n<\/pre>\n<p>Then, in the second part we will separate only the CLSIDs whose values from\u00a0 <em>OutTimeDbl<\/em> parameter is zero, which means this alarm hasn&#8217;t left its condition yet:<\/p>\n<p>&nbsp;<\/p>\n<pre>SELECT * FROM (SELECT Min(EventCLSID) AS EventCLSID, SUM(OutTimeDbl) AS OutTimeDbl FROM Alarms\r\nWHERE InTime > DATEADD(hh, -48, GETDATE())\r\nGROUP BY EventCLSID)tbA\r\nWHERE OutTimeDbl = 0\r\n\r\n<\/pre>\n<p>Finally, the last query (the first in this article) returns the alarms whose CLSIDs are the same as the ones returned in the query above. Therefore, we have the registers of alarms that still haven&#8217;t left the active condition.<\/p>\n<p>In order to return only alarms that remain active when they get in, you must create a filter with <em>Acked<\/em> parameter values, as seen below:<\/p>\n<p>&nbsp;<\/p>\n<pre><span style=\"color: #000120;\">SELECT * FROM Alarms RIGHT JOIN \r\n(SELECT * FROM (SELECT Min(EventCLSID) AS EventCLSID, SUM(OutTimeDbl) AS OutTimeDbl FROM Alarms WHERE InTime > DATEADD(hh, -48, GETDATE()) \r\nGROUP BY EventCLSID)tbA \r\nWHERE OutTimeDbl = 0)tbB ON Alarms.EventCLSID = tbB.EventCLSID\r\n<strong>WHERE Acked = 0\r\n\r\n<\/strong><\/span><\/pre>\n<p><span style=\"color: #000120;\">Query&#8217;s result:\u00a0<\/span><\/p>\n<p><span style=\"color: #000120;\"><strong><br \/>\n<img loading=\"lazy\" class=\"alignnone wp-image-10586 size-full\" src=\"http:\/\/kb.elipse.com.br\/wp-content\/uploads\/2020\/04\/10577\/FAA_SQL02.png\" alt=\"consulta retorna alarmes ativos elipse e3\" width=\"697\" height=\"76\" \/><\/strong><\/span><\/p>\n<p><strong>NOTE:<\/strong> In this article, we used Microsoft SQL Server as the database for creating the queries.<\/p>\n<h3>Related articles:<\/h3>\n<hr \/>\n<ul>\n<li><a href=\"https:\/\/kb.elipse.com.br\/en\/structure-query-language-sql-introduction\/\" target=\"_blank\" rel=\"noopener noreferrer\">Structure Query Language (SQL): Introduction<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Question: How can I return the active alarms in Elipse E3 via database records? Solution: In order to return the active alarms\u00a0 in Elipse E3 (acknowledged or not), you must&hellip;<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[732,735,743],"tags":[1055,1054,1056],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>KB-108744: How to return the active alarms in Elipse E3 via database.<\/title>\n<meta name=\"description\" content=\"This article shows how to use an E3Query to return all Elipse E3 active alarms (aknowledged or not) via records in the database.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"KB-108744: How to return the active alarms in Elipse E3 via database.\" \/>\n<meta property=\"og:description\" content=\"This article shows how to use an E3Query to return all Elipse E3 active alarms (aknowledged or not) via records in the database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-14T13:29:46+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/kb.elipse.com.br\/wp-content\/uploads\/2020\/04\/10577\/FAA_SQL01.png\" \/>\n<meta name=\"author\" content=\"Marco Antonio Gomes Silva\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marco Antonio Gomes Silva\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/\"},\"author\":{\"name\":\"Marco Antonio Gomes Silva\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9\"},\"headline\":\"KB-108744: Returning Elipse E3&#8217;s active alarms via database.\",\"datePublished\":\"2020-07-14T13:29:46+00:00\",\"dateModified\":\"2020-07-14T13:29:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/\"},\"wordCount\":220,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"keywords\":[\"active alarms database\",\"active alarms\",\"return active alarms from database\"],\"articleSection\":[\"AlarmServer \/ AlarmConfig\",\"DataBases\",\"E3Query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/\",\"name\":\"KB-108744: How to return the active alarms in Elipse E3 via database.\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2020-07-14T13:29:46+00:00\",\"dateModified\":\"2020-07-14T13:29:46+00:00\",\"description\":\"This article shows how to use an E3Query to return all Elipse E3 active alarms (aknowledged or not) via records in the database.\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"KB-108744: Returning Elipse E3&#8217;s active alarms via database.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9\",\"name\":\"Marco Antonio Gomes Silva\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g\",\"caption\":\"Marco Antonio Gomes Silva\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/marco\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KB-108744: How to return the active alarms in Elipse E3 via database.","description":"This article shows how to use an E3Query to return all Elipse E3 active alarms (aknowledged or not) via records in the database.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/","og_locale":"en_US","og_type":"article","og_title":"KB-108744: How to return the active alarms in Elipse E3 via database.","og_description":"This article shows how to use an E3Query to return all Elipse E3 active alarms (aknowledged or not) via records in the database.","og_url":"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2020-07-14T13:29:46+00:00","og_image":[{"url":"http:\/\/kb.elipse.com.br\/wp-content\/uploads\/2020\/04\/10577\/FAA_SQL01.png"}],"author":"Marco Antonio Gomes Silva","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Marco Antonio Gomes Silva","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/"},"author":{"name":"Marco Antonio Gomes Silva","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9"},"headline":"KB-108744: Returning Elipse E3&#8217;s active alarms via database.","datePublished":"2020-07-14T13:29:46+00:00","dateModified":"2020-07-14T13:29:46+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/"},"wordCount":220,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"keywords":["active alarms database","active alarms","return active alarms from database"],"articleSection":["AlarmServer \/ AlarmConfig","DataBases","E3Query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/","url":"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/","name":"KB-108744: How to return the active alarms in Elipse E3 via database.","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2020-07-14T13:29:46+00:00","dateModified":"2020-07-14T13:29:46+00:00","description":"This article shows how to use an E3Query to return all Elipse E3 active alarms (aknowledged or not) via records in the database.","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/kb-108744-how-to-return-the-active-alarms-in-elipse-e3-via-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"KB-108744: Returning Elipse E3&#8217;s active alarms via database."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9","name":"Marco Antonio Gomes Silva","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g","caption":"Marco Antonio Gomes Silva"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/marco\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/11111"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=11111"}],"version-history":[{"count":5,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/11111\/revisions"}],"predecessor-version":[{"id":11123,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/11111\/revisions\/11123"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=11111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=11111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=11111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}