Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleted record conflicts with new record
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00508856
Message ID:
00508874
Vues:
22
>>>I have a primary index (ordernum) on a table (orders).
>>>
>>>If I delete record ordernum=1 then try to add a new
>>>ordernum=1 I get a message stating that the uniqueness
>>>of primary key ordernum is violated. Is there any way
>>>to make the vfp5 ignore deleted records when adding a
>>>new one with the same key?
>>
>>
>>You would have to add the NOT DELETED() filter to you primary key
>>
>>
>>
>>- Brian
>
>Yes... I see that would work but is that a good practice?


Well, I know that there are many people who prescribe to the philosophy that primary keys should never, ever, under any circumstance be reused. However, depending on what is being done or what's trying to be accomplished, it might be ok...maybe even necessary. There are times when I need to use a DELETED() filter on a key. Whether or not it is a good/bad practice? Eh, sometimes it needs to be done.


- Brian


VFP6 SP5, VFP8 SP1, VFP 9 SP 1 and Win XP SP 3 (unless otherwise specified)


www.wulfsden.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform