# PrepQuery with SQL Variable

**URL:** <https://forum.inductiveautomation.com/t/prepquery-with-sql-variable/66509>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [November 15, 2022, 8:12am UTC](https://forum.inductiveautomation.com/t/prepquery-with-sql-variable/66509 "2022-11-15T08:12:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [November 15, 2022, 12:49pm UTC](https://forum.inductiveautomation.com/t/prepquery-with-sql-variable/66509/4 "2022-11-15T12:49:01Z")

</div>

Do note that using SQL variables is SQL _ **scripting** _, which isn't actually in the JDBC spec. Some drivers allow it, but you really shouldn't be doing that if you want your work to be portable.

Single statements for JDBC. Scripts belong in stored procedures.

---

_[View the full topic](https://forum.inductiveautomation.com/t/prepquery-with-sql-variable/66509)._
