[Gambas-user] Could be this change included?

Leandro Anthonioz Blanc leandro_anthonioz at ...43...
Tue Feb 20 03:35:03 CET 2007


Hi folks. I needed get a resultset from a MySQL stored procedure. However, when I execute
a line like this:

hResult = hConn.Exec("CALL MyStoredProcedure(2)")

I get the following error:

"PROCEDURE MyStoredProcedure can't return a result set in the given context"

Later, I read in MySQL documentation ("24.2.9. C API Handling of Multiple Statement
Execution") this:

"The mysql_real_connect() function has a flags argument for which two option values are
relevent: * CLIENT_MULTI_RESULTS enables the client program to process multiple results.
This option must be enabled if you execute CALL statements for stored procedures that
produce result sets. Otherwise, such procedures result in an error Error 1312 (0A000):
PROCEDURE proc_name can't return a result set in the given context."

Therefore, I edit open_database() function in gb.db.mysql/src/main.c file. I modify the
mysql_real_connect call changing last argument (0) to CLIENT_MULTI_RESULTS constant and
works fine. Could be this change included in future versions of Gambas please? Thank you
very much.



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com




More information about the User mailing list