Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to find orphans - seek vs SQL
Message
De
15/12/2000 03:06:35
Walter Meester
HoogkarspelPays-Bas
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00444141
Message ID:
00453813
Vues:
39
Nadya,

>Just suddenly I thought about one solution here, which can help. What if before deletion we would assign KeyID=-KeyID? In this case, all deleted records would have negative IDs and then your solution would work. Do you think it's an interesting idea, which I can probably discuss between our team members?

Hmmm, a few members of the UT already practise this to overcome a uniqueness pk violation. Yes, this works. However I still think that a primary (or candidate) index filtered on DELETED() might be a better solution.

Good luck,

Walter,

>>Hi Nadya,
>>>>SCAN FOR !KEYMATCH(ProgID,nYourTagNo,"Table2")
>>>
>>>Great! With KeyMatch it took only 29,5sec. with set deleted on and 23,8 sec with set deleted off.
>>
>>>Yes, you suggested the best method. The only little problem with deleted records, but I may add another condition in scan for!keymatch() and !deleted('PropMstr') It should not slow down the process.
>>
>>Sorry to disappoint you but the DELETED() function is getting you nowhere here. Since the recordpointer in the second table is never moved there is no quick way to check if the related record in table2 is deleted, unless you'are sure that the index does not contain any nodes for deleted records. This can be done in two ways:
>>1. ensure that there are no deleted records in table2.
>>2. ensure that the index used in KEYMATCH is filtered with "FOR !DELETED().
>>
>>Walter,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform