Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary keys useless?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00047863
Message ID:
00048419
Vues:
25
>>>>Federico,
>>>>note that in VFP a deleted record is not removed from the tabel (until you
>>>>pack or do some similar action)
>>>>thus the deleted keys still exists and can potentially be restored
>>>>
>>>>you can either use surrogate keys , which is a name to keys that bare no
>>>>relation to the data ( most recomended IMHO)
>>>>another option is to recycle used keys - i.e. recall the deleted record and
>>>>overwrite the data
>>>>yet another option is to add a filter on the primary key - but IMHO this is
>>>>not a very good idea (kinda beats the whole idea primary keys if you ask me)
>>>>
>>>>Arnon
>>>
>>>Sorry, what is IMHO? And why is adding a filter not a good idea? Anyway, most people don't regard deleted records as 'existing' records. Would there be any problem for the VFP standard referential integrity functions to work with the filter? Would it be necessary to create surrogated key for all tables?
>>>
>>>
>>>Tai SC
>>
>>IMHO is "In My Humble Opinion", meaning that this is what the writer thinks is the best way. Usually used when other people have different opinions and there is no actual facts.
>>
>>If you have come to VFP from non-xBase languages, then it's hard to understand how VFP handles deleted records - keeping them available until you 'pack' the table or recall the deleted records. This comes from the first dBaseII program, and has been kept in for about 15 years.
>>
>>It can be useful, since you can re-use an old record instead of doing an INSERT or APPEND BLANK. You have to make decisions on how to treat the old keys, however, as has been covered above.
>>
>>Barbara
>Barbara,
>
>I agree that VFP way of handling deleted records can, like you've said, be useful but IMHO :)), I think in most cases it is a "feature" that I could do without. On numerous occasions, I've embarresingly given wrong information to my boss because I forgot to SET DELETED ON before manual adhoc query/report generation. Yes, it was my oversite but most, if not all other modern RDBMS's do not handle deleted records in quite VFPs way and I think there is a good reason why (I've just given you one of them).
>
>John.

John, anyone switching in and out of xBase programming soon starts to swear at the delete/pack duo. Unfortunately, I think Fox is stuck with this because of so many programs that used deleted records as invisible records. If they were going to change, it should have been done with VFP3.

Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform