Page 1 of 1

Update failed. Found n records

Posted: Tue 11 Feb 2014 10:49
by ralle1
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.

Re: Update failed. Found n records

Posted: Wed 12 Feb 2014 14:40
by ralle1
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!!

Re: Update failed. Found n records

Posted: Tue 18 Feb 2014 14:09
by PavloP
Unfortunately, we can't reproduce the problem.
Please try to reproduce the problem on the latest IBDAC version 5.2.5.