mysql-nio icon indicating copy to clipboard operation
mysql-nio copied to clipboard

Is it Possible to Call Stored Procedures via SimpleQuery ?

Open Phil89a opened this issue 3 years ago • 9 comments

I am trying out MySQL-NIO and I want to be able to call a Stored Procedure from my MySQL database and return the result set to my Swift application, however the SimpleQuery is failing with...

MySQL error: Server error: PROCEDURE Accounts.display_Transactions can't return a result set in the given context

The Stored Procedure only has one select, so it is only returning one result set. If I replace the call with the actual SQL from the Stored Procedure it works.

Is it possible to call a Stored Procedure in this way - or is there another method I should be using ?

thanks

Phil

Phil89a avatar Jan 03 '22 13:01 Phil89a

cc @gwynne

0xTim avatar Jan 04 '22 17:01 0xTim

It is currently not possible to call a stored procedure using MySQLNIO at all; there is no implementation of the CLIENT_MULTI_RESULTS capability yet. It's on my TODO list 😕.

gwynne avatar Jan 04 '22 17:01 gwynne

Ah pity as I need to keep most of my logic on the server. Not having Stored Procedures means lots of client side logic and SQL statements :(

Hopefully something that can be added soon ?

Phil89a avatar Jan 04 '22 17:01 Phil89a

Yeah, I'm hoping to get to it in the next couple of weeks.

gwynne avatar Jan 04 '22 17:01 gwynne

Excellent - I can survive until then :-)

Phil89a avatar Jan 04 '22 17:01 Phil89a

I would also love to have this 😃

whiterockstudios avatar Jun 26 '22 02:06 whiterockstudios

when calls to stored procedures will be supported?

pingrami avatar Jun 28 '22 12:06 pingrami

Any idea if calling stored procedure from Vapor will ever be available?

sunpeakstudio avatar Oct 01 '23 19:10 sunpeakstudio

ping @gwynne

0xTim avatar Nov 24 '23 17:11 0xTim