lunarmodules / luasql

LuaSQL is a simple interface from Lua to a DBMS.
http://lunarmodules.github.io/luasql
535 stars 192 forks source link

Calling a simple MySQL select stored procedure returns can't return a result set in the given context #68

Open samlevi1981 opened 7 years ago

samlevi1981 commented 7 years ago

I have a mysql stored procedure like this:

_CREATE DEFINER=root@localhostPROCEDUREget_record`( In mKey varchar(300) ) BEGIN

Select * from table_name where column_name = mkey;

END`_

And in LUA, I call it using the luasql.mysql:

_`local qry_str = "Call get_record('"..mkey.."')" cur = assert (con:execute(qry_str))

row = cur:fetch ({}, "a") `_ It returns the following error after executing it:

_LuaSQL: error executing query. MySQL: PROCEDURE dbname.get_record can't return a result set in the given context_

Calling that stored procedure in MySQL workbench works as expected.

Does luasql supports this type of procedure? And if it does, how do I call it via lua?

Thanks!