Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unique ID Violated With Add/Delete
Message
From
15/06/1998 12:52:23
 
 
To
15/06/1998 12:45:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00108257
Message ID:
00108261
Views:
33
Hi Lincoln ---

Bear in mind that the DELETED() status has nothing to do with the uniqueness of a candidate or primary index. In any incremental key situation, you have to search all your table whether or not the records have been deleted.


>I have a procedure to generate sequential unique values for a field used as a Candidate key when new records are added to my parent table. It works fine when new records are added as long as a new record hasn't been deleted. My procedure searches the table for matches in the candidate field; if it doesn't find a match it increments by one and returns the value to the field. If a new record was just added and then deleted and you try to add another new record an error message indicates a Unique_ID violation. I understand if the record were recalled instead of packed it would indeed be a violation of uniqueness and thus why I'm getting the error message. It seems my procedure doesn't compare the return value with deleted records (deleted but not yet packed).
>
>How can I remedy this situation?
>
>TIA
>
>--lincoln
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform