Kbase P97345: Database loads duplicate data that is within a unique index when a question mark is used?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  6/14/2005 |
|
Status: Verified
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.0x
SYMPTOM(s):
Database loads duplicate data that is within a unique index
Question marks ? are passed in for field values
Performing a FIND FIRST on the unique index displays error (3166)
More than one <table> records found by a unique FIND. (3166)
The index is declared as unique
CAUSE:
This is the expected behavior. 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.
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. These 2 records are both found with the following statement:
FIND FIRST customer WHERE last-name = "SMITH" and first-name = ?.
FIX:
All fields that are part of a unique index should also be made MANDATORY.