# Database error when logging to alarm journal

**URL:** <https://forum.inductiveautomation.com/t/database-error-when-logging-to-alarm-journal/9467>\
**Category:** Ignition\
**Created:** [December 19, 2014, 8:55pm UTC](https://forum.inductiveautomation.com/t/database-error-when-logging-to-alarm-journal/9467 "2014-12-19T20:55:16Z")\
**Posts on this page:** 4\
**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:** [December 19, 2014, 8:55pm UTC](https://forum.inductiveautomation.com/t/database-error-when-logging-to-alarm-journal/9467/1 "2014-12-19T20:55:16Z")

</div>

We’ve set up an alarm journal and are getting a database error every time the tag goes into its alarm state. The error as logged on the console is:

```auto
java.sql.SQLSyntaxErrorException: ORA-00923: FROM keyword not found where expected
```

We’ve managed to track down the SQL being sent to the database and it’s:

```auto
SELECT "alarm_events"SEQ.CURRVAL FROM DUAL
```

I think there are two problems here and they’re both related to the double quotes. One, the end quote in the middle of the sequence name, rather than at the end. Two, the sequence was not created with double quotes so its name is ALARM\_EVENTSSEQ and the case-sensitive “alarm\_eventsSEQ” wouldn’t match it.

We tried changing the table name for the alarm journal to all caps, but the quote mark is still in the wrong place.

This is Ignition 7.6.3 under Oracle 11gR2. I know our version is a bit behind, but I looked in the change logs and didn’t see anything relevant.

---

<div class="post-metadata">

**Author:** ![matt.eaton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matt.eaton/32/72046_2.png) [@matt.eaton](https://forum.inductiveautomation.com/u/matt.eaton)\
**Post date:** [January 30, 2015, 2:15pm UTC](https://forum.inductiveautomation.com/t/database-error-when-logging-to-alarm-journal/9467/2 "2015-01-30T14:15:35Z")

</div>

shouldn’t your query be something like  
SELECT ALARM\_EVENTSSEQ.CURRVAL FROM DUAL

[stackoverflow.com/questions/7425 … -sensitive](http://stackoverflow.com/questions/7425153/reason-why-oracle-is-case-sensitive)

Unless this link is wrong it says that the values passed to select are always case insensitive, so you shouldn’t need the double quotes in any case.

---

<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:** [January 30, 2015, 2:47pm UTC](https://forum.inductiveautomation.com/t/database-error-when-logging-to-alarm-journal/9467/3 "2015-01-30T14:47:24Z")

</div>

[quote=“matt.eaton”]shouldn’t your query be something like  
SELECT ALARM\_EVENTSSEQ.CURRVAL FROM DUAL

That’s correct. The double quotes actually make the query case sensitive, while Oracle is case insensitive by default. If I wasn’t clear, this isn’t my query; this is coming from within the Ignition alarm logging framework itself when it tries to log an alarm.

---

<div class="post-metadata">

**Author:** ![matt.eaton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matt.eaton/32/72046_2.png) [@matt.eaton](https://forum.inductiveautomation.com/u/matt.eaton)\
**Post date:** [February 6, 2015, 3:55pm UTC](https://forum.inductiveautomation.com/t/database-error-when-logging-to-alarm-journal/9467/4 "2015-02-06T15:55:23Z")

</div>

I remember seeing options for this in the gateway.  
It’s under Databases\>Drivers\>Translators

The settings for the Oracle Translator show the pattern and escape character it’s using.  
Maybe you can just remove the column escape character as a workaround.  
But this definitely looks like a bug to me.
