Subject Re: [IBO] Duplicates in Table
Author Helen Borrie
At 03:06 PM 17-12-02 +0200, you wrote:
>I have since discovered duplicates in one of my tables.
>
>this Occored while accessing the data , and by mistake came accross this as
>I was
>reading from first to Eof.
>
>I then noted that there was duplicates in the PRIMARY KEY , can you believe
>that.
>
>I then had to delete it ,, but my Question is this :
>
>Is there any tools out there ( dll ) or vcl that I could use to check the
>Databse
>firebird 1.0.xxx ?

I don't understand what you want to check.


>Has it ever been possible to create a Database with a primary key no being
>unique ?

No, it is completely impossible. The likely explanation is that you have
data that you think is duplicate but in fact is not - such as case
differences, blanks added to the end of character key elements, etc.


>What could have caused this.

You run the risk of "false duplicates" if you have applications that allow
users to edit keys.


>I have restored the database from several backups. But yet the "IBX" backup
>service
>does not complain, and never did to my knowledge.

The IBX backup service uses macro calls to gbak.exe. Gbak definitely
complains about duplicates in primary keys. The only conclusion is that
the problem is in your data and the means you have implemented for creating
and maintaining keys.


>What should I do ,, this is live data. I have since fixed the duplicate
>entries ,, but
>who knows what lied beyond the mercy waters ?

You should consider restructuring your database so that keys are atomic
(have no meaning and cannot be altered); and you should re-architect your
application so that either users never see the keys, or keys are always
read-only. If you need more detailed help with this, you need to provide
better information about your metadata.

As a general observation, your problem is off-topic for the IBO
list. Please use the ib-support list for problems relating to your database.

Helen