Using the Transaction manager, Trying to write a basic OPC item string message “AU1234567” to a MySQL db table. I get the coerce error “java.lang.Double” but I am trying to write it to a VARCHAR. I’ve also tried LONGTEXT but get the same error. My version is 7.2.9. Any ideas?
Did you change the group’s index column to point to that column as well? I suspect so, and the group expects the index column to be a number (normally it is an integer). If you didn’t, there are a few other places that error could come from. Check the log in the gateway under Console and see if you can find more details about the error. Or, perhaps you could export the group (right click on the group) and post it and I can take a look.
On the value change I intend to insert a new row with the new string value. I am simply trying to log Alphanumeric serial #'s. Attached is the XML file for the group.
Bar code logging group.xml (2.52 KB)
Sorry for the delay. It looks like the problem is with the trigger: the group expect it to be numeric. So, even though you have it set to “Active on value change”, it is trying to convert it to a double.
However, the option above- “only evaluate when values have changed”- will accept any type of data. So, I would simply use that, and uncheck the “execute on trigger” option. If you need a more complex trigger, you can add a run-always expression item with an expression that evaluates to 0 or 1, and trigger off of that. The “hasChanged()” expression function is useful in that case.
Ultimately, we should make the “active on change” trigger not sensitive to the data type.