# Alarm Journal broken with Oracle

**URL:** <https://forum.inductiveautomation.com/t/alarm-journal-broken-with-oracle/10822>\
**Category:** Ignition\
**Created:** [November 24, 2015, 6:00pm UTC](https://forum.inductiveautomation.com/t/alarm-journal-broken-with-oracle/10822 "2015-11-24T18:00:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eaolson](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@eaolson](https://forum.inductiveautomation.com/u/eaolson)\
**Post date:** [November 24, 2015, 6:00pm UTC](https://forum.inductiveautomation.com/t/alarm-journal-broken-with-oracle/10822/1 "2015-11-24T18:00:48Z")

</div>

I’ve found that the Alarm Journal Table widget does not work when the journal is on an Oracle datasource. The table displays with the 301 “Comm Error” overlay. Output Console contains this error:

`WARN [AlarmJournalTable-AWT-EventQueue-2] Error fetching alarms.
java.util.concurrent.ExecutionException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: java.sql.SQLSyntaxErrorException: ORA-00920: invalid relational operator
`  
I went into the database trace file and I believe this is the SQL statement causing the error:

`SELECT e."id", e."eventid", e."source", e."displaypath", e."priority", e."eventtime", e."eventtype", e."eventflags" FROM "ALARM_EVENTS" e WHERE e."eventtime" >= :1 AND e."eventtime" <= :2 AND (e."eventflags" & :3 > 0 OR (e."eventflags" & :4 = 0))
`

I assume the "&"s are trying to do a bitwise AND on eventflags and the bind variables. That’s not valid in Oracle. You have to use the BITAND function ([docs.oracle.com/database/121/SQ … SQLRF00612](https://docs.oracle.com/database/121/SQLRF/functions022.htm#SQLRF00612)).

Also, the table name is double-quoted, which makes it case-sensitive, but it seems to have been created without the quotes, because it’s upper cased in my database. I can get around that by editing the Journal profile and uppercasing the table names in the Advanced section. I don’t think there’s any workaround for the “&” problem.

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [November 24, 2015, 7:07pm UTC](https://forum.inductiveautomation.com/t/alarm-journal-broken-with-oracle/10822/2 "2015-11-24T19:07:31Z")

</div>

Which version of Ignition are you using?

---

<div class="post-metadata">

**Author:** ![eaolson](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@eaolson](https://forum.inductiveautomation.com/u/eaolson)\
**Post date:** [November 24, 2015, 7:21pm UTC](https://forum.inductiveautomation.com/t/alarm-journal-broken-with-oracle/10822/3 "2015-11-24T19:21:51Z")

</div>

Noticed this on 7.6.3 on Linux. I’m pretty sure it exists in 7.8.0 as well.

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [November 24, 2015, 7:28pm UTC](https://forum.inductiveautomation.com/t/alarm-journal-broken-with-oracle/10822/4 "2015-11-24T19:28:40Z")

</div>

I checked the latest 7.8 and 7.7 releases and they are working fine, and using BITAND in the query. On the 7.6 branch, you’ll have to update to 7.6.7 to fix this issue.

---

<div class="post-metadata">

**Author:** ![eaolson](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@eaolson](https://forum.inductiveautomation.com/u/eaolson)\
**Post date:** [November 24, 2015, 8:25pm UTC](https://forum.inductiveautomation.com/t/alarm-journal-broken-with-oracle/10822/5 "2015-11-24T20:25:22Z")

</div>

Ah, it does seem to be fixed in 7.8.
