# Insert into the database from 2 different sources

**URL:** <https://forum.inductiveautomation.com/t/insert-into-the-database-from-2-different-sources/51997>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 15, 2021, 4:50pm UTC](https://forum.inductiveautomation.com/t/insert-into-the-database-from-2-different-sources/51997 "2021-10-15T16:50:28Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Rahul\_Bhakte1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Rahul\_Bhakte1](https://forum.inductiveautomation.com/u/Rahul_Bhakte1)\
**Post date:** [September 21, 2023, 7:27am UTC](https://forum.inductiveautomation.com/t/insert-into-the-database-from-2-different-sources/51997/14 "2023-09-21T07:27:23Z")

</div>

Hello, I am facing the similar issue. That I want to insert entire dataset into database table.  
I followed the code by @lrose but getting below error.

Code:

```auto
data1 = system.tag.read("[default]TEST/Tag").value
pyData = system.dataset.toPyDataSet(data1)
query = "INSERT INTO MyTable (C1, C2, C3, C4, C5, C6, C7) VALUES %s"
                            
valueArgs = ','.join(['(?,?,?,?,?,?,?)'] * data1.getRowCount())
argList = [row for row in pyData]
system.db.runPrepUpdate(query % valueArgs, argList, 'MyDB')

```

Error:

```auto
Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Unable to decode arguments

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

	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:325)

	at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:278)

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

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

	... 23 more

Caused by: java.io.InvalidClassException: failed to read class descriptor

```

I am not sure what I am missing here.

---

_[View the full topic](https://forum.inductiveautomation.com/t/insert-into-the-database-from-2-different-sources/51997)._
