Hello all. I'm using zde6.5.1+delphi7+mysql4.1 and i can't make tzquery do more then 1 statement at a time. I do this:
ZQuery1.SQL.Add('INSERT INTO BankPlatez (DOC_NO) VALUES (''1'');');
ZQuery1.SQL.Add('INSERT INTO BankPlatez (DOC_NO) VALUES (''2'');');
ZQuery1.ExecSQL;
ang got error. mysql accepts them as 1 line. Fmultistatements is false, FSQL.StatementCount=1. TZQuery has no direct access to FMultistatements property. WHat did i do wrong? What shell i do?
TZQuery and multistatements
Moderators: gto, cipto_kh, EgonHugeist
And how about article on this server "The ZeosLib DBOs 6.1.5 - With Delphi 7 and Firebird 1.5"
:
With Query do Begin
Sql.Clear;
Sql.Add('DELETE FROM table1;');
Sql.Add('INSERT INTO table1 VALUES (:Val1, :Val2);');
Sql.Add('INSERT INTO table2 VALUES (:Val3, :Val2);');
Sql.Add('UPDATE table3 SET field1 = :Val4;');
Params.ParamByName('Val1').AsInteger := 123;
:
ExecSql;
End;
:
maybe i missunderstand something? maybe it applies only to firebird? not to mysql?
:
With Query do Begin
Sql.Clear;
Sql.Add('DELETE FROM table1;');
Sql.Add('INSERT INTO table1 VALUES (:Val1, :Val2);');
Sql.Add('INSERT INTO table2 VALUES (:Val3, :Val2);');
Sql.Add('UPDATE table3 SET field1 = :Val4;');
Params.ParamByName('Val1').AsInteger := 123;
:
ExecSql;
End;
:
maybe i missunderstand something? maybe it applies only to firebird? not to mysql?