roxen.lists.pike.general

Subject Author Date
Re: Unable to call MySQL stored procedures from Pike v7.6 release JCRM <Pike[at]quick-hacks[dot]co[dot]uk> 12-02-2009
 112
This attached patch is only half a solution really, but it at least lets
you use stored procedures with pike.

you need to enable multi-result sets like this:

Sql.mysql db = Sql.mysql(host, database, username, password,
                          ([ "connect_options"
                             : Sql.mysql.CLIENT_MULTI_RESULTS]));


Multiple result sets makes mysql a lot more stateful, so you need to be
much more careful how you handle the Sql.Mysql object and results, and
using the same object across threads is pretty much a no-no.

In the usual setup here, the web user has no access to the database
itself, only stored procedures and functions. The stored procedures are
written in three styles - those that return nothing, those that return
exactly one row, and the rest. The second attachment are the pike
functions I currently use to facilitate this usage.

As time allows, I plan to provide a stored procedure class, but I don't
have a lot of spare time at the moment