# runPrepUpdate BigInteger

**URL:** <https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316>\
**Category:** Ignition\
**Created:** [September 21, 2011, 10:13pm UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316 "2011-09-21T22:13:06Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [September 21, 2011, 10:13pm UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316/1 "2011-09-21T22:13:06Z")

</div>

Why am I receiving this error when I try and run and update query?

[quote]Traceback (innermost last):  
File “event:actionPerformed”, line 15, in ?  
java.lang.Exception: Error executing system.db.runPrepUpdate(UPDATE tblAdmin\_GP\_POS\_ItemCodes SET ITEMCODE=? WHERE ID=?, [A90XW20A, 5906], , , false)

```
at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.error(AbstractDBUtilities.java:293)

at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.runPrepUpdate(AbstractDBUtilities.java:218)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java)

at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. __call__ (ScriptManager.java:313)

at org.python.core.PyObject. __call__ (PyObject.java)

at org.python.core.PyObject.invoke(PyObject.java)

at org.python.pycode._pyx20.f$0(<event:actionPerformed>:15)

at org.python.pycode._pyx20.call_function(<event:actionPerformed>)

at org.python.core.PyTableCode.call(PyTableCode.java)

at org.python.core.PyCode.call(PyCode.java)

at org.python.core.Py.runCode(Py.java)

at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:394)

at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:139)

at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:247)

at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)

at $Proxy0.actionPerformed(Unknown Source)

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$000(Unknown Source)

at java.awt.EventQueue$1.run(Unknown Source)

at java.awt.EventQueue$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)

at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)

at java.awt.EventQueue$2.run(Unknown Source)

at java.awt.EventQueue$2.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.AccessControlContext$1.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)

```

Caused by: com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: Gateway Error 202: Error executing prepared statement. Unknown class ‘BigInteger’ at argument 1

```
at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:280)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:276)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.runPrepStmt(GatewayInterface.java:457)

at com.inductiveautomation.ignition.client.script.ClientDBUtilities._runPrepStmt(ClientDBUtilities.java:71)

at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.runPrepUpdate(AbstractDBUtilities.java:216)

... 54 more

```

java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(UPDATE tblAdmin\_GP\_POS\_ItemCodes SET ITEMCODE=? WHERE ID=?, [A90XW20A, 5906], , , false)

```
at org.python.core.Py.JavaError(Py.java)
at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.error(AbstractDBUtilities.java:293)
at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.runPrepUpdate(AbstractDBUtilities.java:218)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java)
at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. __call__ (ScriptManager.java:313)
at org.python.core.PyObject. __call__ (PyObject.java)
at org.python.core.PyObject.invoke(PyObject.java)
at org.python.pycode._pyx20.f$0(<event:actionPerformed>:15)
at org.python.pycode._pyx20.call_function(<event:actionPerformed>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.Py.runCode(Py.java)
at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:394)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:139)
at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:247)
at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:55)
at $Proxy0.actionPerformed(Unknown Source)
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$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.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)

```

Ignition v7.2.8 (b178)  
Java: Sun Microsystems Inc. 1.6.0\_26  
[/quote]

Thank you,

---

<div class="post-metadata">

**Author:** ![Greg.Buehler](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Greg.Buehler](https://forum.inductiveautomation.com/u/Greg.Buehler)\
**Post date:** [September 21, 2011, 10:23pm UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316/2 "2011-09-21T22:23:32Z")

</div>

Dumb question: is your query encapsulated in quotes?

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [September 21, 2011, 10:36pm UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316/3 "2011-09-21T22:36:08Z")

</div>

this is what is looks like in code

```auto
system.db.runPrepUpdate("UPDATE tblAdmin_GP_POS_ItemCodes SET ITEMCODE=? WHERE ID=?", [item["ITEMCODE"],item["ID"]])
```

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 21, 2011, 10:57pm UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316/4 "2011-09-21T22:57:35Z")

</div>

The key here is :

[tt]Error executing prepared statement. Unknown class ‘BigInteger’ at argument 1[/tt]

Try putting int() around your params, like

```auto
system.db.runPrepUpdate("UPDATE tblAdmin_GP_POS_ItemCodes SET ITEMCODE=? WHERE ID=?", [int(item["ITEMCODE"]), int(item["ID"])])
```

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [September 21, 2011, 10:59pm UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316/5 "2011-09-21T22:59:15Z")

</div>

Note: I doubt the item code “A90XW20A” is supposed to be an int 😛  
But yeah, try that for the ID.

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [September 21, 2011, 11:06pm UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316/6 "2011-09-21T23:06:00Z")

</div>

yes that worked. will there be a problem when the integer gets really big?

---

<div class="post-metadata">

**Author:** ![Greg.Buehler](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Greg.Buehler](https://forum.inductiveautomation.com/u/Greg.Buehler)\
**Post date:** [September 22, 2011, 1:31am UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316/7 "2011-09-22T01:31:55Z")

</div>

Well you should technically only have problems if you excede the capabilities of the `long` datatype, which is 9223372036854775807.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 22, 2011, 4:02pm UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316/8 "2011-09-22T16:02:11Z")

</div>

It’s just Python being somewhat silly about casting it’s number datatype to Java’s Object type in the absence of any useful type information for it to use as a hint.

This is something that we can improve on our end.

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [November 2, 2012, 1:39pm UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316/9 "2012-11-02T13:39:31Z")

</div>

I have the same problem as described in the above post, but in my case the int() conversion does not work.  
Here is the error:

```auto
Traceback (most recent call last):
  File "<event:actionPerformed>", line 38, in <module>

java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO proddaten_log (id, startzeit, matnr, gewicht) values (?,?,?,?), [411, 1351862541203, 2865100, 1.280000], energiemgmt, , false)

	caused by Exception: Error executing system.db.runPrepUpdate(INSERT INTO proddaten_log (id, startzeit, matnr, gewicht) values (?,?,?,?), [411, 1351862541203, 2865100, 1.280000], energiemgmt, , false)
	caused by GatewayException: Error executing prepared statement. Unknown class 'BigInteger' at argument 1

Ignition v7.5.4-beta4 (b1182)
Java: Sun Microsystems Inc. 1.6.0_34
```

The runPrepUpdate is excecuted in a client button script. I also tried long() instead of int() with the same result. The target column is a MySQL BigInteger, the value itself is a timestamp.

```auto
system.db.runPrepUpdate("INSERT INTO proddaten_log (id, startzeit, matnr, gewicht) values (?,?,?,?)", [anlage, int(neueStartzeitMS), matnr, gewicht], "energiemgmt")
```

The query works if i insert the value directly into the query, but i don’t really like that solution.

---

<div class="post-metadata">

**Author:** ![markdobtech](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@markdobtech](https://forum.inductiveautomation.com/u/markdobtech)\
**Post date:** [November 2, 2012, 1:51pm UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316/10 "2012-11-02T13:51:05Z")

</div>

I believe a fix is in the works for this.

[viewtopic.php?f=70&t=8964&p](http://www.inductiveautomation.com/forum/viewtopic.php?f=70&t=8964&p)

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [November 5, 2012, 9:05pm UTC](https://forum.inductiveautomation.com/t/runprepupdate-biginteger/3316/11 "2012-11-05T21:05:06Z")

</div>

That’s correct, there is a bug ticket made for this. I will add the information about int() casting not working for you, thanks.
