# Drop Selected Alarms (Database Journal)

**URL:** <https://forum.inductiveautomation.com/t/drop-selected-alarms-database-journal/85577>\
**Category:** Ignition\
**Tags:** ignition81, scripting, vision\
**Created:** [February 12, 2024, 6:56pm UTC](https://forum.inductiveautomation.com/t/drop-selected-alarms-database-journal/85577 "2024-02-12T18:56:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [February 12, 2024, 6:56pm UTC](https://forum.inductiveautomation.com/t/drop-selected-alarms-database-journal/85577/1 "2024-02-12T18:56:08Z")

</div>

I would like to add a button to my window (only visible in the designer) that I could use to quickly drop rows from the underlying alarm database. (alarms that were raised as a result of testing - that I don't want to confuse operators with)

The alarm journal is configured as an SQL database source. Just not sure how I go about it with all the different related tables in the database.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [February 12, 2024, 8:12pm UTC](https://forum.inductiveautomation.com/t/drop-selected-alarms-database-journal/85577/2 "2024-02-12T20:12:42Z")

</div>

Selecting the rows and inspecting the Selected Alarms prop, I see the EventId column, but I get no results when I try and use the query browser.

```auto
SELECT * from alarm_events where eventid = "c4584a93-b62d-4aca-8620-bfd5acc4a61f"

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 12, 2024, 8:14pm UTC](https://forum.inductiveautomation.com/t/drop-selected-alarms-database-journal/85577/3 "2024-02-12T20:14:13Z")

</div>

Use single quotes for values in SQL. Double quotes are for identifiers.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [February 12, 2024, 8:14pm UTC](https://forum.inductiveautomation.com/t/drop-selected-alarms-database-journal/85577/4 "2024-02-12T20:14:43Z")

</div>

Still nothing

```auto
SELECT * from alarm_events where eventid = 'c4584a93-b62d-4aca-8620-bfd5acc4a61f'

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 12, 2024, 8:15pm UTC](https://forum.inductiveautomation.com/t/drop-selected-alarms-database-journal/85577/5 "2024-02-12T20:15:33Z")

</div>

You may need to cast that value to the DB's UUID type.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [February 12, 2024, 8:16pm UTC](https://forum.inductiveautomation.com/t/drop-selected-alarms-database-journal/85577/6 "2024-02-12T20:16:52Z")

</div>

Looks like it uses a different event ID.

event ID in the alarm journal component:

```auto
c4584a93-b62d-4aca-8620-bfd5acc4a61f

```

selecting using the source instead, I see event ID:

```auto
9acbaa2a-adec-41e6-9153-d067bca70d63

```

(that's the only alarm event with the same source)

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [February 13, 2024, 7:25pm UTC](https://forum.inductiveautomation.com/t/drop-selected-alarms-database-journal/85577/7 "2024-02-13T19:25:46Z")

</div>

Whoever set up the table set it up as an alarm status table looking at only cleared events, instead of a journal. These were orphaned alarms and that's why they didn't show up in the database.
