ZMSQL Update question lazarus / 16-Databases ---------------------------------------------------------------------- scons · 2018-01-30 11:48 Hi all, I have found some time to test some more with ZMSQL. I ran in to the following: you have 2 tables (table1, table2), I want to update table1 with data from table2 where 2 values (or ID's) match. 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.BtnUpdateClick(Sender: TObject);begin  ZMQueryDataSet3.SQL.Clear;  ZMQueryDataSet3.SQL.AddText('UPDATE table1 SET zghl1 = (SELECT table2.SL FROM table2 WHERE table2.ID=table1.PNR; COMMIT;)');  ZMQueryDataset3.QueryExecute;end;  Table1 gets altered but no update (values stay the same), so I think there must be something wrong with the SELECT part ? I also tried : 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   ZMQueryDataSet3.SQL.AddText('UPDATE table1 SET zghl1 = (SELECT table2.SL as zghl1 FROM table2 WHERE table2.id=table1.pnr; COMMIT;)');  but no updates, what am I missing here ? Thanks ---------------------------------------------------------------------- scons · 2018-02-04 13:35 I think I am missing something in the "SELECT" procedure. Would someone be so kind to explain why my SELECT button does show an empty result ? Thanks