EDBEngineError "Multiple records found but only one was expected"


2004-01-08 06:18:06 AM
off-topic6
Hi, all,
I've been trying over the last couple of days to try and get a handle on a
problem that we're experiencing with one of our
applications.
First, the setup:
Interbase 7.1
BDE
Delphi 7 Enterprise
Windows XP Pro.
We have a table defined in our Interbase database that has one unique index
that is a composite index of four fields. Three of the fields are populated
by our application, while the fourth is populated by a generator/trigger
combo. One field is defined as:
ASSOCIATION INTEGER DEFAULT 0 NOT NULL
In our client application, we have a TTable component that is used to update
the information in this table like so:
Table.Insert;
Table.FieldByName('Invoice_nbr').AsInteger := InvoiceNbr;
.
.
.
Table.Post;
We frequently post multiple records at once (the above pseudocode is in a
loop that is applied for each record).
Generally, we can post one record with no problem. However, if we attempt
to post multiple records simultaneously, we receive an EDBEngineError
exception with the message mentioned in the subject of this post.
The interesting thing is that we can remove the "DEFAULT 0" clause from the
definition of the ASSOCIATION field (which, by the way, is NOT part of the
unique index), and posting multiple rows works just fine.
Does anyone have any ideas about this?
Thanks in advance for any assistance,
Brian