Ignition to MySQL java.sql.SQLSyntaxErrorException

It seems MySQL is throwing a syntax error for this script.
This script is supposed to read in a 1000 character string and parse it into groups.
Then send a multi row query to the database.


This is the error Ignition is giving back.
It also shows what the completed query looks like and the data used.

You should probably consider refactoring your script to use system.db.runPrepUpdate so you can better handle your parameterized field values. As to the specific syntax error, it probably not liking the lack of single quotes around each of the string values.

If you need to ensure that multiple rows are added atomically, you could also use a transaction to bind together multiple insert statements and then commit at the end. (as a possible alternative to building this bulk-insert statement–if it cleans up the code, it might be worth it)

Thank you. It was the single quotes that were missing. I found 1 tutorial out of a half dozen that even had single quotes in it, and never found anything that mentioned string queries requiring single quotes. I spent 2 days in conference with an Inductive Automation support engineer on this, and we couldn’t get it working.