Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unique but not unique
Message
 
 
À
20/08/2008 19:47:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01340637
Message ID:
01340638
Vues:
13
>How would you insure that the entries in a given field are unique OR blank? That is, multiple blank records are OK but if data is entered, it must be a unique value. Setting up a candidate index doesn't work due to the blank fields.

Don,

Can you use NULL instead blanks? Are you using buffering?

You can do something like
lnRecord = recno() && Save current record pointer
set order to myField
if seek(myNewValue)
  scan while myField = myNewValue
     if recno() <> m.lnRecord  && Duplicate
       exit
   endif
  endscan
endif
Also may be we can set a candidate index with the FILTER? Try FOR not empty(FIELD). Just an idea.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform