Called for each modified, inserted or deleted record on applyupdates, to replace the automatically generated update statement, e.g. for a query on a join
Source position: msesqldb.pas line 225
published property tmsesqlquery.onapplyrecupdate : applyrecupdateeventty |
Called for each modified, inserted or deleted record on applyupdates, to replace the automatically generated update statement, e.g. for a query on a join. Return the SQL statement in asql (it is executed in the write transaction), leave it empty to use the generated statement, or set done to True if the update was done otherwise. Build the values with fieldtosql or the assql function of the fields:
procedure tmainfo.recupdate(const sender: tmsesqlquery; const updatekind: tupdatekind; var asql: msestring; var done: boolean); begin if updatekind = ukmodify then begin asql:= 'update TABLE1 set FIELD1 = '+field1.assql+ ' where PK = '+pk.assql; end; end;