# Get result of a Stored Procedure

**URL:** <https://forum.inductiveautomation.com/t/get-result-of-a-stored-procedure/42034>\
**Category:** Ignition\
**Created:** [January 7, 2021, 5:52pm UTC](https://forum.inductiveautomation.com/t/get-result-of-a-stored-procedure/42034 "2021-01-07T17:52:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric.avila](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@eric.avila](https://forum.inductiveautomation.com/u/eric.avila)\
**Post date:** [January 7, 2021, 5:52pm UTC](https://forum.inductiveautomation.com/t/get-result-of-a-stored-procedure/42034/1 "2021-01-07T17:52:31Z")

</div>

Hi,

I have a Stored Procedure and this return me a message,

i can get the message but in a table, and i want to send this message to the user in a messageBox or something else, but i cant get the result of the table.

can i get the message in other component?

Or how can i get the value of the table in the position row(0) and column (0)?  
I only can found the function .data and getRowCount but this don`t help me.

thanks

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [January 7, 2021, 6:49pm UTC](https://forum.inductiveautomation.com/t/get-result-of-a-stored-procedure/42034/2 "2021-01-07T18:49:57Z")

</div>

Sounds like it returns a dataset. If so you can use [.getValueAt(0,0)](https://docs.inductiveautomation.com/display/DOC81/Datasets). There is a section in the [manual](https://docs.inductiveautomation.com/display/DOC81/Datasets) that talks specifically about scripting with dataset and describes the different functions that can be used.

---

<div class="post-metadata">

**Author:** ![chandler](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@chandler](https://forum.inductiveautomation.com/u/chandler)\
**Post date:** [January 7, 2021, 8:01pm UTC](https://forum.inductiveautomation.com/t/get-result-of-a-stored-procedure/42034/3 "2021-01-07T20:01:22Z")

</div>

If it is always in the first row and first column, you could execute it as a scalar query, which always returns the value contained in the first row and column. Then you wouldn’t have to worry about getting the value from the dataset after running the query.

---

<div class="post-metadata">

**Author:** ![eric.avila](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@eric.avila](https://forum.inductiveautomation.com/u/eric.avila)\
**Post date:** [January 7, 2021, 8:15pm UTC](https://forum.inductiveautomation.com/t/get-result-of-a-stored-procedure/42034/4 "2021-01-07T20:15:33Z")

</div>

Thanks,

i put this

result=event.source.parent.getComponent(‘table’).data  
result2=result.getValueAt(0,0)

Ando this worked.

thanks

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [January 7, 2021, 8:23pm UTC](https://forum.inductiveautomation.com/t/get-result-of-a-stored-procedure/42034/5 "2021-01-07T20:23:35Z")

</div>

You should even be able to do it as a single line like:

```auto
result=event.source.parent.getComponent('table').data.getValueAt(0,0)

```
