ODBC Database alarm logging


Recommended Posts


I cant get the date to work when logging alarms to database im using mariadb mysql

this is what i get 


test Test;Test; 4


with the logging sets i have set Custom Time Formatting to %Y%m%d%H%M%S , but i cant do that with alarms.


-- Table structure for table `alarmlog`

CREATE TABLE `alarmlog` (
  `TheTime` date DEFAULT NULL,
  `Name` text DEFAULT NULL,
  `Description` text DEFAULT NULL,
  `Priority` tinytext DEFAULT NULL,
  `Status` tinytext DEFAULT NULL

Link to comment
Share on other sites

It posts the time in Excel time format, meaning as a number that is decimal days since 1900.  This is what worked on the databases we tested when this was first added, but obviously appears to not always work.  You have two options:

1) change "TheTime" to a floating point instead of date.  Then it should post correctly, but of course then the time stamp will be a number instead of something human readable.  You also might try setting TheTime to datetime instead of just date.

2) log alarms yourself using the alarm events and a sequence function to do the logging and db. functions.  This will allow you to log however you want.  The only challenge is that you have to go through all of your alarms and add a line of script for each of the 3 events you want to log.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.