Consultor Eletrônico



Kbase 17107: How non-unique records get in through a unique index (3166)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
How non-unique records get in through a unique index (3166)

You can declare an index to be unique, and still have records
that seem to be duplicates of that index get into the database. If
you do a FIND FIRST on that index, you will get the following error:

More than one <table> records found by a unique FIND. (3166)

For example, if you make an index by last-name and first-name and
then make it unique, you cannot add 2 John Smith's to the table.
However, you will be able to add 2 records with the last-name of
Smith and an unknown first-name. This is because the unknown value
(represented by a ? in the database) is truly unknown, and when the
record is inserted, the 2 unknown values are not judged to be equal.

These 2 records are both found with the following statement however:

FIND FIRST customer WHERE last-name = "SMITH" and first-name = ?.

To resolve this problem, all fields that are part of a unique index
should also be made MANDATORY.

Progress Software Technical Support Note # 17107