Hello,
My scenario is batch inserting using the following method:
FBufferSize := 1000;
...
FLiteConnection.SQL.Params[0][FDBCount].AsLongWord := FCount;
FLiteConnection.SQL.Params[1][FDBCount].AsInteger := FHasher.GetHashValue(aExpression);
FLiteConnection.SQL.Params[2][FDBCount].AsLongWord := FTextRecordNumber;
...
Inc(FDBCount);
if (FDBCount = FBufferSize) then
begin
FLiteConnection.SQL.Execute(FDBCount);
FDBCount := 0;
end;
...
// End of process
if (FDBCount <> 0) then
begin
FLiteConnection.SQL.Execute(FDBCount);
FDBCount := 0;
end;
In the end of process, if the value of FDBCount=1, I get a ‘UNIQUE constraint failed’.
If I skip the SQL.Execute if FDBCount=1 and close everything, it does seem to save the record anyway.
If FDBCount>1, no issues. If I set the FBufferSize := 1, of course no problem.
I have a lot of records so simple inserts would take too much time.
I tried using a TLiteQuery connected to the connection, same problem.
Am I doing anything wrong? If not, is there a bug fix out?
I have the standard version (no source code).
Pierre
Insert Batch Update
Re: Insert Batch Update
Thank you for your information. Unfortunately, the information you provided is not enough to reproduce the problem. Please use the e-support form (https://www.devart.com - the menu "Support" \ "Request Support") to compile and send us a complete example of the way you fill the table. In addition, this example should include a DDL-script to create the table used in this example.
-
- Posts: 7
- Joined: Tue 25 Jul 2017 13:53
Re: Insert Batch Update
Sorry for the delay, I was on vacation.
As requested, I sent you a project that reproduces the issue.
Looking forward to your response.
Thank you for your time.
As requested, I sent you a project that reproduces the issue.
Looking forward to your response.
Thank you for your time.
Re: Insert Batch Update
Unfortunately, we did not get the composed project. Try to send it again using the e-support form(https://www.devart.com - the "Support"\"Request Support" menu)
-
- Posts: 7
- Joined: Tue 25 Jul 2017 13:53
Re: Insert Batch Update
I sent the project again. Please confirm you have received it.
Thank you.
Thank you.
Re: Insert Batch Update
Thank you for the information. We reproduced the problem and fixed this bug. The fix will be included in the next LiteDAC build. As a workarround we can send you a night LiteDAC build with these fixes.
For this, provide your license number using the e-support form (https://www.devart.com - the "Support" \ "Request Support" menu) .
For this, provide your license number using the e-support form (https://www.devart.com - the "Support" \ "Request Support" menu) .