Update failed. Found n records

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ralle1
Posts: 43
Joined: Thu 27 May 2010 15:01

Update failed. Found n records

Post by ralle1 » Tue 11 Feb 2014 10:49

Hello!

I’ve got a firebird table with the following properties:

Code: Select all

CREATE TABLE TESTTABLE (
    IDENT       INTEGER NOT NULL,
    TEXT        CHAR(50),
    NEW_UNIQUE  INTEGER
);

ALTER TABLE TESTTABLE ADD CONSTRAINT PK_TESTTABLE PRIMARY KEY (IDENT);

CREATE UNIQUE INDEX A_IDX ON TESTTABLE (NEW_UNIQUE);
The column NEW_UNIQUE and the unique index A_IDX was added after inserting records in the table. Therefore the content of this column is null in each record.

Now I want to edit the column text like this:

Code: Select all

IBCQuery1.Edit;
IBCQuery1.FieldByName('TEXT').AsString := s;
IBCQuery1.Post;	
On the post the message "Update failed. Found 10 records" appears.
It seems that the IBCQuery uses the index A_IDX instead of the primary key to build the where condition.

If I rename the Index A_IDX to Z_IDX, everything works fine.

Im using the following versions:
- Devart IBDAC 3.10.0.16 for Delphi 2007 for Win32
- Firebird 2.5.2

If desired, I will give you a Testprojet and a database.

Thank you for your help.

ralle1
Posts: 43
Joined: Thu 27 May 2010 15:01

Re: Update failed. Found n records

Post by ralle1 » Wed 12 Feb 2014 14:40

Additional I want to tell you, that for Firebird databases, it is allowed to create a unique index on existing tables/columns even if the existing data in the affected column is not unique. In my case descripted above, there are only null values in the fields.

I hope you can understand my description and you can retrace the problem.

Many thanks for your help in advance!!

PavloP
Devart Team
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: Update failed. Found n records

Post by PavloP » Tue 18 Feb 2014 14:09

Unfortunately, we can't reproduce the problem.
Please try to reproduce the problem on the latest IBDAC version 5.2.5.

Post Reply