# Update from Power Table cell SQL Error

**URL:** <https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830>\
**Category:** Ignition\
**Tags:** ignition79, scripting, database\
**Created:** [April 25, 2018, 5:04pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830 "2018-04-25T17:04:43Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuart](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Stuart](https://forum.inductiveautomation.com/u/Stuart)\
**Post date:** [April 25, 2018, 5:04pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/1 "2018-04-25T17:04:43Z")

</div>

I have a Power Table with editable cells that are then written to my database. This works great and all my changes are reflected in the database. The problem comes when I try to refresh the table to show the changes.

The **onCellEdited** function of the table has two lines of code commented out:

```auto
      import system
      self.data = system.dataset.setValue(self.data, rowIndex, colIndex, newValue)

```

If I uncomment them the values in the table do change after I edit them, but I also get this error:

```auto
GatewayException: SQL error for "UPDATE tablename
SET columnname = value
WHERE condition": You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition' at line 3
	caused by MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition' at line 3

Ignition v7.9.7 (b2018032914)
Java: Oracle Corporation 1.8.0_172

```

My guess is that the **onCellEdited** function is being fired twice, and the second time it’s running, it’s missing most of the values.

A work around came up with was to run: `system.db.refresh(self, "data")` which works to show the changes, but it also re-orders the rows etc. which I’d rather not have happen. Leaving the `self.data = system.dataset.setValue(self.data, rowIndex, colIndex, newValue)` commented out means no errors, but that my table shows old data.

Does anyone have any idea why this is happening, and a solution?

Thanks,

---

<div class="post-metadata">

**Author:** ![Stuart](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Stuart](https://forum.inductiveautomation.com/u/Stuart)\
**Post date:** [April 25, 2018, 8:19pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/2 "2018-04-25T20:19:55Z")

</div>

Actually, I’m getting the same error on a different table when trying to drag/drop a row. This table has no cell edit functions, but it is populated from my database.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 25, 2018, 8:28pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/3 "2018-04-25T20:28:38Z")

</div>

Not enough information. Please share the actual SQL from the latter problem.

---

<div class="post-metadata">

**Author:** ![Stuart](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Stuart](https://forum.inductiveautomation.com/u/Stuart)\
**Post date:** [April 25, 2018, 8:32pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/4 "2018-04-25T20:32:35Z")

</div>

The second table has this SQL: `SELECT pmkPart, partNumber, partPrice FROM part`. I don’t think the SQL here is the problem as I am still getting the same error, but no where on this table is there a SQL update.

```auto
GatewayException: SQL error for "UPDATE tablename
SET columnname = value
WHERE condition": You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition' at line 3
	caused by MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition' at line 3

Ignition v7.9.7 (b2018032914)
Java: Oracle Corporation 1.8.0_172

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 25, 2018, 8:34pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/5 "2018-04-25T20:34:17Z")

</div>

Look at the error message window for the name of the component that is generating the error. It probably isn’t either of these tables.

---

<div class="post-metadata">

**Author:** ![Stuart](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Stuart](https://forum.inductiveautomation.com/u/Stuart)\
**Post date:** [April 25, 2018, 8:42pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/6 "2018-04-25T20:42:49Z")

</div>

Here is the full error. `Part table` is the template name, and `Power Table` the component name.

```auto
12:37:45.156 [UpdateExecuter 0] ERROR com.inductiveautomation.factorypmi.application.gateway.QueryManager - Error running update query:
"UPDATE tablename
SET columnname = value
WHERE condition"@-1ms
On: Part Table.Part Table.Power Table.data
com.inductiveautomation.ignition.client.gateway_interface.GatewayException: SQL error for "UPDATE tablename
SET columnname = value
WHERE condition": You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition' at line 3
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:341)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:315)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:268)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.runUpdateQuery(GatewayInterface.java:576)
	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.runUpdateQuery(GatewayInterface.java:560)
	at com.inductiveautomation.factorypmi.application.gateway.QueryManager$UpdateQuery.execute(QueryManager.java:624)
	at com.inductiveautomation.factorypmi.application.gateway.QueryManager$Query.execute(QueryManager.java:657)
	at com.inductiveautomation.factorypmi.application.gateway.QueryManager$Query.access$500(QueryManager.java:630)
	at com.inductiveautomation.factorypmi.application.gateway.QueryManager$UpdateQueryExecutor.run(QueryManager.java:425)
	at java.lang.Thread.run(Unknown Source)
Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayResponse$GatewayThrowable: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition' at line 3
	at sun.reflect.GeneratedConstructorAccessor72.newInstance(null)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(null)
	at java.lang.reflect.Constructor.newInstance(null)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
	at com.mysql.jdbc.Util.getInstance(Util.java:386)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2788)
	at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1816)
	at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1730)
	at org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:228)
	at com.inductiveautomation.ignition.gateway.datasource.DelegatingStatement.executeUpdate(DelegatingStatement.java:80)
	at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper$SRStatement.executeUpdate(SRConnectionWrapper.java:857)
	at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.RunUpdateQuery.runUpdateQuery(RunUpdateQuery.java:35)
	at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.AbstractUpdateQuery.run(AbstractUpdateQuery.java:37)
	at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.AbstractDBAction.invoke(AbstractDBAction.java:77)
	at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:405)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:85)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
	at org.eclipse.jetty.server.Server.handle(Server.java:518)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
	at java.lang.Thread.run(null)

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 25, 2018, 9:18pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/7 "2018-04-25T21:18:30Z")

</div>

Consider taking the table out of the template and dropping on an empty window and playing with it there. Something on the data binding is executing what appears to be a default (dummy) update query.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 25, 2018, 9:20pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/8 "2018-04-25T21:20:28Z")

</div>

It looks like you somehow got an update query turned on for bi-directional binding on a dataset property?

---

<div class="post-metadata">

**Author:** ![Stuart](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Stuart](https://forum.inductiveautomation.com/u/Stuart)\
**Post date:** [April 26, 2018, 12:04am UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/9 "2018-04-26T00:04:16Z")

</div>

That is sort of what it looks like. I’ll try some more things and report back with any findings.

I noticed this problem shortly after upgrading to 7.9.7, but I also added other things at that time so it may be unrelated.

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [April 26, 2018, 6:12pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/10 "2018-04-26T18:12:26Z")

</div>

@Stuart  
I have the same issue one couple of my windows and I also did start noticing it after 7.9.7, The one window I’m using I only have two components that have a SQL binding, one a power table and the other a custom property dataset on the root container and neither of those you can enable the update option under SQL binding because it doesn’t exist so it’s very puzzling…  
wondering if more people have notices this…🤔  
My error points to the dataset custom property

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 26, 2018, 6:15pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/11 "2018-04-26T18:15:44Z")

</div>

Is there any chance you originally placed that binding by copying it from a scalar property where the update option was turned on?

---

<div class="post-metadata">

**Author:** ![ikenna.nwaogu](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@ikenna.nwaogu](https://forum.inductiveautomation.com/u/ikenna.nwaogu)\
**Post date:** [June 6, 2018, 4:50pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/12 "2018-06-06T16:50:18Z")

</div>

Am having the same issue. My project worked fine on 7.9.2, 7.9.6 but failed to work on 7.9.7. Could it be a bug? because at first it was automatically switching to the bi-directional update after I have turned it off.

Then I left the update part blank and switched it off. Now, I cant update the sql bind property. when I open the binding and press OK button whether I update it or not I get the below error

```auto
===========================================================================
Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
	at com.inductiveautomation.factorypmi.application.binding.SQLPropertyAdapter.getBindingConfiguration(SQLPropertyAdapter.java:117)
	at com.inductiveautomation.factorypmi.designer.property.configurators.ConfiguratorMultiplexor$EditorParent.getBindingConfiguration(ConfiguratorMultiplexor.java:284)
	at com.inductiveautomation.factorypmi.designer.property.configurators.ConfiguratorMultiplexor$EditorParent.tryCommit(ConfiguratorMultiplexor.java:266)
	at com.inductiveautomation.factorypmi.designer.property.configurators.ConfiguratorMultiplexor.tryCommit(ConfiguratorMultiplexor.java:468)
	at com.inductiveautomation.factorypmi.designer.property.configurators.DynamicOptsDialog.doOK(DynamicOptsDialog.java:95)
	at com.inductiveautomation.factorypmi.designer.property.configurators.DynamicOptsDialog.access$000(DynamicOptsDialog.java:43)
	at com.inductiveautomation.factorypmi.designer.property.configurators.DynamicOptsDialog$1.actionPerformed(DynamicOptsDialog.java:64)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.WaitDispatchSupport$2.run(Unknown Source)
	at java.awt.WaitDispatchSupport$4.run(Unknown Source)
	at java.awt.WaitDispatchSupport$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(Unknown Source)
	at java.awt.Dialog.show(Unknown Source)
	at java.awt.Component.show(Unknown Source)
	at java.awt.Component.setVisible(Unknown Source)
	at java.awt.Window.setVisible(Unknown Source)
	at java.awt.Dialog.setVisible(Unknown Source)
	at com.inductiveautomation.factorypmi.designer.property.configurators.DynamicOptsDialog.showDialog(DynamicOptsDialog.java:163)
	at com.inductiveautomation.factorypmi.designer.model.VisionDesignerImpl.openBindingDialog(VisionDesignerImpl.java:1125)
	at com.inductiveautomation.factorypmi.designer.property.editors.bb.DynamicOptionsButton.actionPerformed(DynamicOptionsButton.java:37)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at com.jidesoft.plaf.basic.BasicJideButtonListener.mouseReleased(Unknown Source)
	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at javax.swing.plaf.basic.BasicTableUI$Handler.repostEvent(Unknown Source)
	at javax.swing.plaf.basic.BasicTableUI$Handler.mouseReleased(Unknown Source)
	at com.jidesoft.swing.DelegateMouseInputListener.mouseReleased(Unknown Source)
	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
===========================================================================================

```

this binding isn’t on the table itself but on a dropdown that references the table and its a power table. Thanks.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 6, 2018, 4:59pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/13 "2018-06-06T16:59:27Z")

</div>

It’s a bug, fixed in 7.9.8.

---

<div class="post-metadata">

**Author:** ![ikenna.nwaogu](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@ikenna.nwaogu](https://forum.inductiveautomation.com/u/ikenna.nwaogu)\
**Post date:** [June 6, 2018, 6:23pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/14 "2018-06-06T18:23:02Z")

</div>

Thank you @paul-griffith.

---

<div class="post-metadata">

**Author:** ![Myllka](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/myllka/32/4140_2.png) [@Myllka](https://forum.inductiveautomation.com/u/Myllka)\
**Post date:** [June 8, 2018, 1:20pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/15 "2018-06-08T13:20:54Z")

</div>

We’re in 7.9.8 since yesterday and we just run on the exact same bug @ikenna.nwaogu

---

<div class="post-metadata">

**Author:** ![jimmillereads](https://avatars.discourse-cdn.com/v4/letter/j/90db22/32.png) [@jimmillereads](https://forum.inductiveautomation.com/u/jimmillereads)\
**Post date:** [June 9, 2018, 4:04pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/16 "2018-06-09T16:04:25Z")

</div>

I get the same error in 7.9.8 in two different apps. Really bothers the customer.  
The UPDATE succeeds. It’s just that an error is reported, seemingly erroneously.

It’s a simple SELECT for a powertable. I’ve tried using runSFPrepQuery (and without SF). Error does not occur for MSSQL, but only for MySQL. Looks like the error is occurring in the java execution as the error reports:

GatewayException: SQL error for "UPDATE tablename  
**SET columnname = value**  
**WHERE condition"** : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘condition’ at line 3  
caused by MySQLSyntaxErrorException: You have an error in your SQL syntax; check[details=Summary]This text will be hidden[/details] the manual that corresponds to your MySQL server version for the right syntax to use near **‘condition’ at line 3**

Not sure why it’s reporting generic “columnname” and generic “condition” in the error message. Line 3 is also not the correct line in my script. That’s what makes me think it’s referring to a line # in the underlying java code.

Any work around found yet?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 9, 2018, 8:44pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/17 "2018-06-09T20:44:10Z")

</div>

Just upgrading to 7.9.8 won’t fix the corrupted bindings that were saved in 7.9.7. You have to delete and re-create the binding one more time.

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [June 11, 2018, 4:24pm UTC](https://forum.inductiveautomation.com/t/update-from-power-table-cell-sql-error/17830/18 "2018-06-11T16:24:42Z")

</div>

@pturmel  
Yeah I noticed those errors still stuck around but thankfully deleting and redoing those is much easier than recreating a table that has all sorts of bells and whistles lol.  
Glad to see that bug was fixed!!
