I'm having problems with a stored procedure that returns only one column.
ResultSet_getColumnName(rset,1) has the header info but ResultSet_getString(rset,1) is empty. When i run it on MySQL it works.
Please advice.
Joe
On Apr 7, 2012, at 1:41 AM, Joe Flemmings wrote:
I'm having problems with a stored procedure that returns only one column.
ResultSet_getColumnName(rset,1) has the header info but ResultSet_getString(rset,1) is empty. When i run it on MySQL it works.
I have no idea. We have never tried libzdb with a stored procedure, but don't see why it should not work. If you can provide a reproducible test program I'll investigate. Otherwise, lift the code from the stored procedure out into your program.
I remember when i was using the C API i set CLIENT_MULTI_RESULTS or CLIENT_MULTI_STATEMENTS for this to work. Just wondering if their are flags for doing this on MySQL
Thanks
Joe
On Fri, Apr 6, 2012 at 4:53 PM, Jan-Henrik Haukeland hauk@tildeslash.comwrote:
On Apr 7, 2012, at 1:41 AM, Joe Flemmings wrote:
I'm having problems with a stored procedure that returns only one column.
ResultSet_getColumnName(rset,1) has the header info but
ResultSet_getString(rset,1) is empty. When i run it on MySQL it works.
I have no idea. We have never tried libzdb with a stored procedure, but don't see why it should not work. If you can provide a reproducible test program I'll investigate. Otherwise, lift the code from the stored procedure out into your program. -- To unsubscribe: http://www.tildeslash.com/mailman/listinfo/libzdb-general
On Apr 7, 2012, at 2:15 AM, Joe Flemmings wrote:
I remember when i was using the C API i set CLIENT_MULTI_RESULTS or CLIENT_MULTI_STATEMENTS for this to work. Just wondering if their are flags for doing this on MySQL
CLIENT_MULTI_STATEMENTS is already set, but not CLIENT_MULTI_RESULTS (as ResultSet only holds one result), but do try to modify src/db/mysql/MysqlConnection.c and add this to the doConnect() function to see if it works.
Otherwise the only "flags" available are documented here http://tildeslash.com/libzdb/api-docs/mysqloptions.html
You have everything i had the problem was that i was not doing
while (ResultSet_next(rset)) { ResultSet_getColumnName(rset,1); ResultSet_getString(rset,1); }
I was just doing
ResultSet_getColumnName(rset,1); ResultSet_getString(rset,1);
without ResultSet_next
Joe
On Fri, Apr 6, 2012 at 5:23 PM, Jan-Henrik Haukeland hauk@tildeslash.comwrote:
On Apr 7, 2012, at 2:15 AM, Joe Flemmings wrote:
I remember when i was using the C API i set CLIENT_MULTI_RESULTS or
CLIENT_MULTI_STATEMENTS for this to work. Just wondering if their are flags for doing this on MySQL
CLIENT_MULTI_STATEMENTS is already set, but not CLIENT_MULTI_RESULTS (as ResultSet only holds one result), but do try to modify src/db/mysql/MysqlConnection.c and add this to the doConnect() function to see if it works.
Otherwise the only "flags" available are documented here http://tildeslash.com/libzdb/api-docs/mysqloptions.html -- To unsubscribe: http://www.tildeslash.com/mailman/listinfo/libzdb-general