Using Delphi 10.3 & RODA Version 10.0.0.1579
A simple Insert statement with an ID field (primary key) using a sequence in SQL Server 2019.
Although the record is correctly inserted, an error occurs.
Error: -1: Can’t refresh delta, record isn’t found
procedure TfrmMain.Button1Click(Sender: TObject);
var
mData: TdmDetailData;
begin
mData := TdmDetailData.Create(Self);
try
mData.tblQuestions.Open;
with mData.tblQuestions do
begin
Insert;
FieldByName('Question').AsString := 'Does it work now?';
FieldByName('Subject').AsInteger := 2;
FieldByName('Category').AsInteger := 1;
FieldByName('MaxTime').AsInteger := 10;
FieldByName('MotivationTime').AsInteger := 0;
Post;
ApplyUpdates;
end;
finally
mData.Free;
end;
end;
can you create a simple testcase that reproduces this case, pls?
You can drop it to support@ for keeping privacy.
I’ve used this testcase for testing sequences testcase.zip (96.9 KB)
DDL:
CREATE TABLE [dbo].[Table_seq](
[id] [bigint] NOT NULL,
[name] [nvarchar](50) NULL,
CONSTRAINT [PK_Table_seq] PRIMARY KEY CLUSTERED
(
[id] ASC
) ON [PRIMARY]
GO
CREATE SEQUENCE [dbo].[seq1]
AS [bigint]
START WITH 1
INCREMENT BY 1
GO
function TDAEFireDACConnection.QueryInterface(const IID: TGUID; out Obj): HResult;
..
end else if IsEqualGUID(IID, IDAUseGenerators) or IsEqualGUID(IID, IDAUseGenerators2) then begin
if not (fDriverType in [mkInterBase, mkFirebird, mkOracle, mkPostgreSQL, mkMSSQL]) then Exit; // changed