Many execution problem

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
r1_mania
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 23.01.2009, 17:37

Many execution problem

Post by r1_mania »

Hi all,
First of all, I want to say that I'm a newbi with ZEOS.
I have a problem with a TZQuery...
After calling a proc, I have the next error : "Commands out of sync, you can't run this command now"

this is my code :

Code: Select all

procedure TCLI_002.Actualiser_Pied_Commande;
var
  qry : TZQuery;
  v_id_cde : integer;
begin
  qry := TZQuery.Create(nil);
  qry.Connection := gConn;
  qry.SQL.Text := 'call GET_PIED_COMMANDE(:P_ID_CDE);';
  qry.ParamByName('P_ID_CDE').Value := FID_Cde;
  try
  begin
    qry.Open;
    if qry.FieldCount >= 3 then
    begin
      StatusBar.Panels[1].Text := 'HT: ' + qry.Fields[0].AsString + ' €';
      StatusBar.Panels[2].Text := 'TTC: ' + qry.Fields[2].AsString + ' €';
    end;
    qry.Close;
  end
  finally
    qry.Free;
  end;
end;
The call works fine the first time but when I call an other statement (with this TZQuery or an other), I have this error.

the MySQL doc specify that it is perhaps due to a leaking call of mysql_use_result. Is is Possible to force this call or something else ?

My connection is (autocommit := false, TransactIsolationLevel := tiNone; Properties.Text := 'CLIENT_MULTI_STATEMENTS=1')

Please help me, I don't know what to do...

Thanks in advance

Fred
r1_mania
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 23.01.2009, 17:37

Post by r1_mania »

Hi all !
It's OK, I follow the solution mentioned on the thread http://zeos.firmos.at/viewtopic.php?t=1141
I used a IStatement instead of TQuery. I'm not understood why the ZQuery doesn't work...

I continue my tests :wink:
Post Reply