Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Permanently deleted..
Message
De
21/10/1999 22:42:27
 
 
À
20/10/1999 04:46:16
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00278216
Message ID:
00279724
Vues:
16
I don't know what the Hacker's Guide says on this subject, but the PACK command does something similar to your code. Ie: It copies the non-deleted records to a temp file, it deletes the original file and renames the temp to the original file name.

IMHO, the only critical moment is when the old file is deleted and the temp one renamed, which both are very short.

In your code, if anything goes wrong while the APPEND is processed, the table is damaged anyway. And this APPEND may take a long time, so, more chances to go wrong.

Vlad

>Hi Vlad,
>Not for you :) If he's doing "pack" for first time I just don't want to be responsible of "gone with the wind" records. Even a power failure occurs in between there wouldn't be loss.
>OTOH as Hacker's Guide suggest I never think to arm end-users with a direct pack command.
>Cetin
>
>>Why is this better?
>>
>>Vlad
>>
>>>If you're doing this first time then I advise you to use another way :
>>>select * from myTable where !deleted() into table myClean
>>>
>>>Then if you're satisfied with myClean.dbf contents :
>>>
>>>use myTable exclusive
>>>zap
>>>append from myClean
>>>
>>>Cetin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform