Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pack command - how to do?
Message
De
26/02/2001 22:15:18
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00479753
Message ID:
00479875
Vues:
44
Hi Nadya,

I believe that the "don't use reindex" tradition is also an old one that became the "rule of thumb" when reindex was broken (back in FP 2.5/2.6 or so).
I believe that it was fixed long ago but old traditions never die, just like the TAG on Deleted().

As for checking the space ahead of time. . . it really isn't necessary as "protection" but rather just to possibly save the time of a wasted effort. The operating system will *not* check this ahead of time for you. But also keep in mind that you are doing a PACK because you have records to delete permanently, so the table will surely not get bigger, but only smaller. But for the .FPT it may not shrink much if you generally do not re-write memo fields. On the other hand, if you do a lot of memo rewriting you could well save more space from this than from packing of the .DBF itself. At worst here, too, it will stay the same size - it will not get bigger.

Cheers,

JimN

>>Nadya,
>>
>>I searched on "pack" and "database" and ran across the discussion you seem to be referring to.
>>
>>Seems that the "dangerous" action is not so much PACK as DELETE TAG ALL because the persistent relationships will be broken when the indexes are deleted. Stonefield's makes sure that all of this is done/rebuilt properly.
>>
>>
>Hi Cindy,
>
>I will reply to all messages which I received so far by answering here. First of all, could you please give me the thread number (I'll try to search again too). I remember the discussion between Ed and Jim, but I want to re-read it again.
>
>Yes, the safest "PACK" seems to be a lot of work in a Database. It could be done the way your described for a free table, but it's really complicated process for table in a database. Currently I implemented just PACK (I haven't inserted code for checking free space, because my manager told me, it would be done at the system level, anyway, it's not hard to add), but I'm nervious, I'm not sure, this is safe. Also, AFAIK, Pack command has an internal reindex. We all know, that it's much better to delete tag all, then re-create all tags again.
>Our databases don't have persistent relationships, so it's not a problem.
>
>Today I ran "Modify Indexes" function on the database and got a message: "Database is invalid. Validate database" on INDEX ON command. Well, after few attempts, I decided to re-create all indexes, so I went to a regime "Re-generate indexes". This time the same error appeared on the line: "Delete tag all". So, we copied database from one drive to another.
>I guess, something was seriously corrupted (last time, I did Re-generate indexes on this database, I interrupted the process by ESC). The question is: how can we prevent these problems?
>
>Thanks again to everyone for reply.
>
>
>>>>First of all, sorry, if this question was asked before. I just don't know, how to search the necessary thread. Searching by "PACK" gave me >3000 threads...
>>>>
>>>>I want to implement pack command in VFP database. I vaguely remember Ed Rauh's response about how it should be done correctly. Could somebody advise (with code samples, if it's possible), what's the best way of implementing "PACK" command in a Database.
>>>>
>>>>I know about Stonefield, but unfortunately, we haven't choosen it in the first place and therefore now it's not an option :(
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform