# SQL Query Help - Bulk Insert

**URL:** <https://forum.inductiveautomation.com/t/sql-query-help-bulk-insert/16527>\
**Category:** Ignition\
**Created:** [January 9, 2018, 3:05pm UTC](https://forum.inductiveautomation.com/t/sql-query-help-bulk-insert/16527 "2018-01-09T15:05:10Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [January 9, 2018, 3:59pm UTC](https://forum.inductiveautomation.com/t/sql-query-help-bulk-insert/16527/3 "2018-01-09T15:59:42Z")

</div>

> [@Sanderd17](#):
>
> The error seems to be about the first argument (@P0), so you should probably try with hardcoded arguments first, and then try to replace those by variables. I don't know to what extend the ?-replacement works with bulk inserts.

This is definitely it. You may not be able to run bulk insert as a prepared statement in this way (up to the JDBC driver, not Ignition); so you may need to use string substitution to insert the filename rather than a parameter substitute. There's some discussion on this topic here:

> [@system.db.runPrepUpdate with variables](http://forum.inductiveautomation.com/t/system-db-runprepupdate-with-variables/16478/3):
>
> Yep… Baging my head on the desk now that I see. Thanks!! For some reason I was stuck on ‘%s’ method of replacing the variable instead of ‘?’.

Also, I cleaned up the code formatting on your post, but @Sanderd17 is definitely correct; wrapping in triple backticks (`) is the preferred way to post code.

---

_[View the full topic](https://forum.inductiveautomation.com/t/sql-query-help-bulk-insert/16527)._
