#1 2024-01-21 13:16:13

tfopc
Member
Registered: 2024-01-08
Posts: 2

TOrmMany/TSQLMany - ManyAdd result

Hi,

if i want to update the pivot-table with new entries i call "PivotTable.ManyAdd" with NoDuplicates=true. But the result is false if the record allready exists.

So the is no difference between ignore insert and a false result because of the false result from Client.Add or UseBatch.Add.

Maybe set the result to true if InternalIDFromSourceDest<>0 is better?

  if NoDuplicates and
     (InternalIDFromSourceDest(aClient, aSourceID, aDestID) <> 0) then
    begin
    result := true;
    exit; // this TRecordReference pair already exists
    end;

best regards,
Tobias

Offline

Board footer

Powered by FluxBB