You are not logged in.
Pages: 1
Hello,
I need help to properly implement the batch insert with possible duplicates in the indexed field.
Initialization:
Props := TSQLDBZEOSConnectionProperties.Create(
Format(
'zdbc:mysql://%s/%s?username=%s;password=%s',
[Server.Host, Server.DataBase, Server.User, Server.Password]),
'', '', '');
Model := CreateKeywordModel;
VirtualTableExternalRegister(Model, [TSQLKeyword], Props);
Client := TSQLRestClientDB.Create(Model, nil, 'SomeTableName', TSQLRestServerDB);
Client.Server.CreateMissingTables;
Then the following:
Client.BatchStart(TSQLKeyword, List.Count, [boInsertOrIgnore]);
for I := 0 to List.Count - 1 do begin
Item := TSQLKeyword(List.Items[I]);
Client.BatchAdd(Item, True);
end;
R := Client.BatchSend(IDs);
R = 500, IDs array has become empty after I tried to insert 10 duplicates with 90 new items. I need a way to count "new" and "duplicates" items. Please advise.
Pages: 1