Commands out of sync

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
marc_3
Posts: 6
Joined: Thu 10 Mar 2016 11:19

Commands out of sync

Post by marc_3 » Wed 23 Mar 2016 10:59

Hello,

I try to work with a stored procedure, but I have the following error message:
Commands out of sync, you can't run this command now.
I saw in the net that it is a problem on mysql side, is it right??
Separetly the procedure works well.

Thanks for helping

marc_3
Posts: 6
Joined: Thu 10 Mar 2016 11:19

Re: Commands out of sync

Post by marc_3 » Wed 30 Mar 2016 12:01

Hello
I come back again with another question related to the Problem.
Is it possible to call mysql_free_result() with Unidac?

By MySQL it is said that the fault could come in this situation.
See MySQL 5.7 Reference Manual.
Manuel's citation :
This can happen, for example, if you are using mysql_use_result() and try to execute a new query before you have called mysql_free_result(). It can also happen if you try to execute two queries that return data without calling mysql_use_result() or mysql_store_result() in between.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Commands out of sync

Post by ViktorV » Wed 30 Mar 2016 12:38

This error may occur in case if your stored procedure returns more than one recordset and the TUniStoredProc.FetchAll property is set to False. In such case, to solve the issue, try to set the FetchAll property to True. If your TUniStoredProc.FetchAll property is set to True and the error is reproduced, then, please, compose a small sample to demonstrate the issue and send it to viktorv*devart*com, including a script to create database objects.

Post Reply