# SQL query Binding to MySQL procedure with OUT parameters

**URL:** <https://forum.inductiveautomation.com/t/sql-query-binding-to-mysql-procedure-with-out-parameters/19934>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [October 2, 2018, 3:32pm UTC](https://forum.inductiveautomation.com/t/sql-query-binding-to-mysql-procedure-with-out-parameters/19934 "2018-10-02T15:32:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [October 2, 2018, 3:32pm UTC](https://forum.inductiveautomation.com/t/sql-query-binding-to-mysql-procedure-with-out-parameters/19934/1 "2018-10-02T15:32:59Z")

</div>

In a MySQL database a procedure is defined as follows:

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/8452725593a7d5b17766c94728bdb3ad03f9a865.png)

I have no problem to call it from a Python script.  
If I play with that in a **Power Table** `data` _SQL query_ binding like this:

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b18ed29029e4621e68cad7a5ea5bdd16cbd8797b.png)

I get no rows and the following error message instead:

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/611adcd84ccfe184b13f86f8269d6000428dbbcf.png)

Calling the procedure with `in_action=6` should return a recordset of recipes.

I’m used to MS SQL Server stored procedures, where you have no OUT parameters and I cannot figure out what the problem is here. Any suggestion?

Thanks in advance, regards

**UPDATE and SOLUTION:**  
Just to answer my post: I dropped the line:  
`set @out=0;`  
and it works. Can anyone explain me? Can’t you submit a whole sql batch to MySQL?

---

<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:** [October 2, 2018, 5:49pm UTC](https://forum.inductiveautomation.com/t/sql-query-binding-to-mysql-procedure-with-out-parameters/19934/2 "2018-10-02T17:49:52Z")

</div>

> [@pgmo](#):
>
> Can't you submit a whole sql batch to MySQL?

No. JDBC drivers take one and only one statement at a time. It's not just MySQL. Running multiple statements is pretty much always a client-side operation for all brands, and JDBC just doesn't offer the parsing for it.
