# Error executing system.db.execSProcCall()

**URL:** <https://forum.inductiveautomation.com/t/error-executing-system-db-execsproccall/29087>\
**Category:** Ignition\
**Created:** [October 15, 2019, 7:22am UTC](https://forum.inductiveautomation.com/t/error-executing-system-db-execsproccall/29087 "2019-10-15T07:22:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harshad.gawande](https://avatars.discourse-cdn.com/v4/letter/h/bc79bd/32.png) [@harshad.gawande](https://forum.inductiveautomation.com/u/harshad.gawande)\
**Post date:** [October 15, 2019, 7:22am UTC](https://forum.inductiveautomation.com/t/error-executing-system-db-execsproccall/29087/1 "2019-10-15T07:22:27Z")

</div>

import datetime  
def AF\_StepPower(Heat\_No):  
call = system.db.createSProcCall(“sp\_calcstepwisepower”)  
call.registerInParam(“ps\_heatnumber”, system.db.VARCHAR, Heat\_No)  
system.db.execSProcCall(call)

I have this script in my ignition. I want to call store procedure with one string type of parameter. Store procedure is in MySql and Ignition version is 7.9.10  
Script is giving following error :at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.error(AbstractDBUtilities.java:362)

```
at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.execSProcCall(AbstractDBUtilities.java:496)

at sun.reflect.GeneratedMethodAccessor148.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

```

java.lang.Exception: java.lang.Exception: Error executing system.db.execSProcCall()

When I tried the same with console script window its executing properly but on tab event change it is not working .

what should be done in such case ?

---

<div class="post-metadata">

**Author:** ![GreggCavazos](https://avatars.discourse-cdn.com/v4/letter/g/90db22/32.png) [@GreggCavazos](https://forum.inductiveautomation.com/u/GreggCavazos)\
**Post date:** [October 15, 2019, 12:07pm UTC](https://forum.inductiveautomation.com/t/error-executing-system-db-execsproccall/29087/2 "2019-10-15T12:07:40Z")

</div>

> [@harshad.gawande](#):
>
> call = system.db.createSProcCall(“sp\_calcstepwisepower”)

have you tried adding the DB? something like

```auto
call = system.db.createSProcCall(“sp_calcstepwisepower”,"DB_NAME")

```

---

<div class="post-metadata">

**Author:** ![jesusaltamirano600](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jesusaltamirano600](https://forum.inductiveautomation.com/u/jesusaltamirano600)\
**Post date:** [January 24, 2023, 9:59pm UTC](https://forum.inductiveautomation.com/t/error-executing-system-db-execsproccall/29087/3 "2023-01-24T21:59:06Z")

</div>

Hi guys.

Im having the same issue. Can you share with me how did you solve it ?
