MySQL Forums
Forum List  »  Connector/C (libmysql)

Re: commands out of sync; stored procedure
Posted by: me mi
Date: May 22, 2015 08:22PM

Mysql store procedures may produce more than one result set, so try to free all result sets before next query like this:

mysql_query(...);
res_ = mysql_store_result(mysql_);
... //read data in result set

//when read data finish, clear all result set.
do
{
if(res_)
{
mysql_free_result(res_);
res_ = NULL;
}

if(mysql_next_result(mysql_) != 0)
break;
res_ = mysql_store_result(mysql_);

}while(true);

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: commands out of sync; stored procedure
981
May 22, 2015 08:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.