# Using Gateway scripts to move data from one database to another

**URL:** <https://forum.inductiveautomation.com/t/using-gateway-scripts-to-move-data-from-one-database-to-another/75953>\
**Category:** Ignition\
**Tags:** perspective, scripting, database\
**Created:** [July 5, 2023, 5:45pm UTC](https://forum.inductiveautomation.com/t/using-gateway-scripts-to-move-data-from-one-database-to-another/75953 "2023-07-05T17:45:00Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [July 5, 2023, 6:05pm UTC](https://forum.inductiveautomation.com/t/using-gateway-scripts-to-move-data-from-one-database-to-another/75953/5 "2023-07-05T18:05:22Z")

</div>

This, handed to `system.db.runPrepUpdate()`, will insert three rows at once:

```auto
INSERT INTO some_table (some_column1, some_column2, some_column3)
VALUES (?, ?, ?),
  (?, ?, ?),
  (?, ?, ?)

```

You would provide the nine arguments in a flat list.

You would construct the SQL dynamically with the right number of inserted row placeholders and the right number of JDBC substitution arguments. Just be careful not to exceed the limit on `?` placeholders. Some JDBC drivers choke at around 2000.

---

_[View the full topic](https://forum.inductiveautomation.com/t/using-gateway-scripts-to-move-data-from-one-database-to-another/75953)._
