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.
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 :
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