# Hyper SQL stored procedure doesn't return result set

**URL:** <https://forum.inductiveautomation.com/t/hyper-sql-stored-procedure-doesnt-return-result-set/18251>\
**Category:** Ignition\
**Created:** [May 31, 2018, 8:40pm UTC](https://forum.inductiveautomation.com/t/hyper-sql-stored-procedure-doesnt-return-result-set/18251 "2018-05-31T20:40:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![douglas.roberts](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@douglas.roberts](https://forum.inductiveautomation.com/u/douglas.roberts)\
**Post date:** [May 31, 2018, 8:40pm UTC](https://forum.inductiveautomation.com/t/hyper-sql-stored-procedure-doesnt-return-result-set/18251/1 "2018-05-31T20:40:03Z")

</div>

I’m trying to call a stored procedure in Hyper SQL by using createSProcCall and execSProcCall. However, no result set is returned. The stored procedure works outside of Ignition though.

Hyper SQL uses a cursor to return a result set from the stored procedure. Are cursors not supported in Ignition when calling a stored procedure?

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [May 31, 2018, 9:14pm UTC](https://forum.inductiveautomation.com/t/hyper-sql-stored-procedure-doesnt-return-result-set/18251/2 "2018-05-31T21:14:32Z")

</div>

Did you import the JDBC driver for HyperSQL in your gateway?

---

<div class="post-metadata">

**Author:** ![douglas.roberts](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@douglas.roberts](https://forum.inductiveautomation.com/u/douglas.roberts)\
**Post date:** [May 31, 2018, 9:20pm UTC](https://forum.inductiveautomation.com/t/hyper-sql-stored-procedure-doesnt-return-result-set/18251/3 "2018-05-31T21:20:43Z")

</div>

Yes and I’m able to connect to the database. The add, update, and delete stored procedures are working.

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [May 31, 2018, 9:23pm UTC](https://forum.inductiveautomation.com/t/hyper-sql-stored-procedure-doesnt-return-result-set/18251/4 "2018-05-31T21:23:51Z")

</div>

Can you post the stored procedure?

---

<div class="post-metadata">

**Author:** ![douglas.roberts](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@douglas.roberts](https://forum.inductiveautomation.com/u/douglas.roberts)\
**Post date:** [June 1, 2018, 1:10pm UTC](https://forum.inductiveautomation.com/t/hyper-sql-stored-procedure-doesnt-return-result-set/18251/5 "2018-06-01T13:10:23Z")

</div>

This isn’t the actual stored procedure. But it functions the same as the real one.

CREATE PROCEDURE MY\_SCHEMA.GET\_DATA(  
IN IN\_ID VARCHAR(50)  
)  
READS SQL DATA  
DYNAMIC RESULT SETS 1  
BEGIN ATOMIC  
DECLARE RESULTS CURSOR WITH RETURN FOR  
SELECT  
t.ID,  
t.DESCRIPTION  
FROM MY\_SCHEMA.MY\_TABLE t  
WHERE  
(IN\_ID IS NULL OR t.ID = IN\_ID)  
ORDER BY t.ID  
FOR READ ONLY;  
OPEN RESULTS;  
END;

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [June 1, 2018, 3:25pm UTC](https://forum.inductiveautomation.com/t/hyper-sql-stored-procedure-doesnt-return-result-set/18251/6 "2018-06-01T15:25:10Z")

</div>

You might find this SO post useful: [https://stackoverflow.com/questions/4343078/jdbc-returning-empty-result-set](https://stackoverflow.com/questions/4343078/jdbc-returning-empty-result-set)
