# Ignition to MySQL java.sql.SQLSyntaxErrorException

**URL:** <https://forum.inductiveautomation.com/t/ignition-to-mysql-java-sql-sqlsyntaxerrorexception/53261>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 18, 2021, 9:04pm UTC](https://forum.inductiveautomation.com/t/ignition-to-mysql-java-sql-sqlsyntaxerrorexception/53261 "2021-11-18T21:04:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harvey\_Kornblum](https://avatars.discourse-cdn.com/v4/letter/h/ee7513/32.png) [@Harvey\_Kornblum](https://forum.inductiveautomation.com/u/Harvey_Kornblum)\
**Post date:** [November 18, 2021, 9:04pm UTC](https://forum.inductiveautomation.com/t/ignition-to-mysql-java-sql-sqlsyntaxerrorexception/53261/1 "2021-11-18T21:04:19Z")

</div>

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.

 ![MySQL Transmit Query](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/7/677e52b6bd974618bafe84fef7278d2b4a27efe7.png)  
This is the error Ignition is giving back.  
It also shows what the completed query looks like and the data used.  
 ![MySQL Transmit Error Log](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/784a8c3a9276b54873493103888162dca86dd0dd.png)

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [November 18, 2021, 9:10pm UTC](https://forum.inductiveautomation.com/t/ignition-to-mysql-java-sql-sqlsyntaxerrorexception/53261/2 "2021-11-18T21:10:47Z")

</div>

You should probably consider refactoring your script to use [system.db.runPrepUpdate](https://docs.inductiveautomation.com/display/DOC81/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)

---

<div class="post-metadata">

**Author:** ![Harvey\_Kornblum](https://avatars.discourse-cdn.com/v4/letter/h/ee7513/32.png) [@Harvey\_Kornblum](https://forum.inductiveautomation.com/u/Harvey_Kornblum)\
**Post date:** [November 18, 2021, 11:49pm UTC](https://forum.inductiveautomation.com/t/ignition-to-mysql-java-sql-sqlsyntaxerrorexception/53261/3 "2021-11-18T23:49:25Z")

</div>

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.
