Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unique but not unique
Message
 
 
To
20/08/2008 19:47:38
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01340637
Message ID:
01340638
Views:
12
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform