Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Packing tables
Message
De
19/07/2001 18:02:16
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00532815
Message ID:
00532889
Vues:
10
>What is the correct way to pack tables. I open the database in exclusive mode. When i say pack tablename, I get an internal error, and Foxpro is closed. When I try and access my tables, I can't , cause the indexes are then screwed. And I have to remove them and add again. Not even a database validate and recover help.
>
>Thanx Stuart

In the index routines for my programs I always remove the index tags before the PACK command. The PACK command will remove the deleted records but then will also rebuild all the structural index tags. If you have any corrupt indexes, they will be rebuilt and still be corrupt. It has happened to me more times than I can count over the years. I always perform the following for my index routines:

USE customer IN 0 ALIAS a_cust EXCLUSIVE
SELECT a_cust
DELETE TAG ALL
PACK
-- Rebuild all index tags
-- Close file

At one of my clients they have 1.4 million records in a table that every couple of months somebody would nuke and have corrupted indexes. The previous programmer would just PACK them and the corrupt indexes still existed. I just added the DELETE TAG ALL line to the index program and fixed it and also cut the reindex program time in half since the indexes are not rebuilt twice, once by the PACK command and then again by the specific INDEX ON commands.

Hope this helps a little.

Jace
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform