# Trying to get a stored procedure to run in report builder. Not finding any good examples. Attached is the code I am using but not returning data

**URL:** <https://forum.inductiveautomation.com/t/trying-to-get-a-stored-procedure-to-run-in-report-builder-not-finding-any-good-examples-attached-is-the-code-i-am-using-but-not-returning-data/21437>\
**Category:** Ignition\
**Created:** [December 16, 2018, 3:11pm UTC](https://forum.inductiveautomation.com/t/trying-to-get-a-stored-procedure-to-run-in-report-builder-not-finding-any-good-examples-attached-is-the-code-i-am-using-but-not-returning-data/21437 "2018-12-16T15:11:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwatkins](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@kwatkins](https://forum.inductiveautomation.com/u/kwatkins)\
**Post date:** [December 16, 2018, 3:11pm UTC](https://forum.inductiveautomation.com/t/trying-to-get-a-stored-procedure-to-run-in-report-builder-not-finding-any-good-examples-attached-is-the-code-i-am-using-but-not-returning-data/21437/1 "2018-12-16T15:11:53Z")

</div>

pGetPart “(@PartNumber)”

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [December 16, 2018, 5:36pm UTC](https://forum.inductiveautomation.com/t/trying-to-get-a-stored-procedure-to-run-in-report-builder-not-finding-any-good-examples-attached-is-the-code-i-am-using-but-not-returning-data/21437/2 "2018-12-16T17:36:41Z")

</div>

I am going to assume that @PartNumber is your parameter for the stored procedure.  
Have you tried just

> pGetPart @PartNumber

---

<div class="post-metadata">

**Author:** ![kwatkins](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@kwatkins](https://forum.inductiveautomation.com/u/kwatkins)\
**Post date:** [December 17, 2018, 12:46pm UTC](https://forum.inductiveautomation.com/t/trying-to-get-a-stored-procedure-to-run-in-report-builder-not-finding-any-good-examples-attached-is-the-code-i-am-using-but-not-returning-data/21437/3 "2018-12-17T12:46:42Z")

</div>

I have tried that but get this error

WARN: Simple Query could not be completedMust declare the scalar variable “@PartNumber”.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [December 17, 2018, 2:21pm UTC](https://forum.inductiveautomation.com/t/trying-to-get-a-stored-procedure-to-run-in-report-builder-not-finding-any-good-examples-attached-is-the-code-i-am-using-but-not-returning-data/21437/4 "2018-12-17T14:21:25Z")

</div>

You need to replace @PartNumber with the component value that you want to pass to the stored procedure.

---

<div class="post-metadata">

**Author:** ![kwatkins](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@kwatkins](https://forum.inductiveautomation.com/u/kwatkins)\
**Post date:** [December 17, 2018, 5:43pm UTC](https://forum.inductiveautomation.com/t/trying-to-get-a-stored-procedure-to-run-in-report-builder-not-finding-any-good-examples-attached-is-the-code-i-am-using-but-not-returning-data/21437/5 "2018-12-17T17:43:41Z")

</div>

Got it working thanks
