zeosdb zupdate don't works lazarus / 16-Databases ---------------------------------------------------------------------- eldonfsr · 2025-03-15 04:09 HI i don't know what i doing wrong zupdate not make changes on table any error but don't affect table information Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i      Dm.ZUPProcess.ModifySQL.Text:='update proccess set training=:training where sonumber=:SoNumber and unitno=:unitno  and proccessno=:proccessno and subprocno=:subprocno ';    Dm.ZUPProcess.Params.ParamByName('SoNumber').AsString:= Dm.SQLSoOrders.FieldByName('SoNumber').AsString;    Dm.ZUPProcess.Params.ParamByName('unitno').AsInteger:= Dm.SQLUnitsOrd.FieldByName('unitno').AsInteger;    Dm.ZUPProcess.Params.ParamByName('proccessno').AsInteger:= Dm.SQLProccess.FieldByName('proccessno').AsInteger;    Dm.ZUPProcess.Params.ParamByName('subprocno').AsInteger:= Dm.SQLProccess.FieldByName('subprocno').AsInteger;    Dm.ZUPProcess.Pa rams.ParamByName('training').AsInteger:=Pass.DataSource.DataSet.FieldB yName('training').AsInteger ;    Dm.SQLProccess.Edit;    Dm.SQLProccess.UpdateRecord;    Dm.ZUPProcess.ModifySQL.Text:= '';   on image my sql and zupdate settings.. ---------------------------------------------------------------------- paweld · 2025-03-15 05:59 TZUpdateSQL is used to update/add/delete records, as the source query is complicated (you use JOINs) or you want to conditionally change the data. Then when you validate the edit in the database components (dbgrid, dbtext, etc.), queries from this component are automatically executed. Of course, you can also call the data edit in code:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);begin  //for update query = 'update proccess set training=:training where sonumber=:sonumber and unitno=:unitno  and proccessno=:proccessno and subprocno=:subprocno'  Dm.ZUPProcess.Edit;  Dm.ZUPProcess.FieldByName('training').AsInteger := 20;   //new training value  Dm.ZUPProcess.Post;end; Only you have to remember that the parameter names must be the same as the column names in the source query, you can possibly use the prefixes OLD_ and NEW_ to separate the previous and new field values. But if you want to manually modify the data, and you want to do it with a different query each time, then in my opinion there is no point in using TZUpdateSQL just use TZQuery and then your code will look more or less like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   Dm.ZQuery.SQL.Text:='update proccess set training=:training where sonumber=:SoNumber and unitno=:unitno  and proccessno=:proccessno and subprocno=:subprocno ';  Dm.ZQuery.Params.ParamByName('SoNumber').AsString := Dm.SQLSoOrders.FieldByName('SoNumber').AsString;  Dm.ZQuery.Params.ParamByName('unitno').AsInteger := Dm.SQLUnitsOrd.FieldByName('unitno').AsInteger;  Dm.ZQuery.Params.ParamByName('proccessno').AsInteger := Dm.SQLProccess.FieldByName('proccessno').AsInteger;  Dm.ZQuery.Params.ParamByName('subprocno').AsInteger := Dm.SQLProccess.FieldByName('subprocno').AsInteger;  Dm.ZQuery.Params.ParamByName('training').AsInteger :=Pass.DataSource.DataSet.FieldByName('training').AsInteger ;  Dm.ZQuery.ExecSQL; ---------------------------------------------------------------------- eldonfsr · 2025-03-15 17:11 Thanks paweld have is tzquery but ithougth use tzupdate can more simple could be in some task is more simple for other is not the right way to do  that.... i goin to use tzupdat for update or delete  datas for table or tzquery... Thanks so much for you r advance...