# Insert SQL with parameters, named query, ERROR

**URL:** <https://forum.inductiveautomation.com/t/insert-sql-with-parameters-named-query-error/63500>\
**Category:** Ignition\
**Created:** [August 26, 2022, 2:26pm UTC](https://forum.inductiveautomation.com/t/insert-sql-with-parameters-named-query-error/63500 "2022-08-26T14:26:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alfredo\_Egmo](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@Alfredo\_Egmo](https://forum.inductiveautomation.com/u/Alfredo_Egmo)\
**Post date:** [August 26, 2022, 2:26pm UTC](https://forum.inductiveautomation.com/t/insert-sql-with-parameters-named-query-error/63500/1 "2022-08-26T14:26:22Z")

</div>

I created a named query  
INSERT into Alarm\_log1 (eMsg, eSubject, Emaildest, Reaction\_code, Alarm\_type, Oven, wireline) VALUES (:pMsg, :eSub, :emailDest, :ReactCode, :AlarmType, :Oven, :Wireline)

but when I try to run it from the TESTING tab it returns the next error  
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near ‘:’.

as I see in the documentation this is the right way to call the parameters, so I am not sure what can be the error, help welcome.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 26, 2022, 2:28pm UTC](https://forum.inductiveautomation.com/t/insert-sql-with-parameters-named-query-error/63500/2 "2022-08-26T14:28:48Z")

</div>

Are all your parameter types correct? If you have a string parameter but it should be an integer I think Ignition would be surrounding it with quotes but then your db will complain. Double check your parameter types.

Also goes without saying but make sure the named query type is an Update query (though I don’t think that is the problem here).

---

<div class="post-metadata">

**Author:** ![Alfredo\_Egmo](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@Alfredo\_Egmo](https://forum.inductiveautomation.com/u/Alfredo_Egmo)\
**Post date:** [August 26, 2022, 2:34pm UTC](https://forum.inductiveautomation.com/t/insert-sql-with-parameters-named-query-error/63500/3 "2022-08-26T14:34:46Z")

</div>

Solved, not sure what was the Error because I just retype the query and it worked.  
thanks

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 26, 2022, 2:52pm UTC](https://forum.inductiveautomation.com/t/insert-sql-with-parameters-named-query-error/63500/4 "2022-08-26T14:52:05Z")

</div>

One thing I’ve noticed with name queries is I need to get out of the tab where you edit them and _then_ save the project to make it take. I’ve had the issue a few times where I edit a named query and thought I saved it and it was in the project but it was not. The most surefire way I’ve found is edit the NQ, get out of it, then save the project and make sure that it is no longer italicized in the project browser.

---

<div class="post-metadata">

**Author:** ![Alfredo\_Egmo](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@Alfredo\_Egmo](https://forum.inductiveautomation.com/u/Alfredo_Egmo)\
**Post date:** [August 26, 2022, 2:52pm UTC](https://forum.inductiveautomation.com/t/insert-sql-with-parameters-named-query-error/63500/5 "2022-08-26T14:52:32Z")

</div>

thank you
