Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
English
Deleting rows from a cursor
Mensaje
 
a
07/12/2002 19:42:59
General information
Foro:
Visual FoxPro
Category:
Programación, sintáxis y comandos
Miscellaneous
ID de la conversación:
00730665
ID del mensaje:
00730688
Views:
12
Jim,

The help is incorrect. It should say that PACK command cannot be used for cursors. In VFP7 you can pack cursor w/o indexes this way
SELECT * FROM crsMycursor ;
  WHERE NOT DELETED() ; 
  INTO CURSOR crsMycursor READWRITE
The WHERE clause can be omitter if SET DELETED is ON.

Now, why PACK doesn't work for cursors? I don't know for sure, but it has something to do with the fact that PACK command doesn't actialy packs the original table. It copies undeleted records to the temp. file, deletes original table and renames temp. table to the original table name. Somewhere in the process it recreates all the indexes, if any exists.

>Erin seems to be happy with your answer,but it does leave me with a question...
>
>The Help for "CREATE CURSOR - SQL Command" says:
>"CREATE CURSOR creates a temporary table that exists until it is closed. You can manipulate a temporary table created with CREATE CURSOR like any other table — you can browse and index it, and you can append and modify records.".
>
>If one can manipulate it like any other table AND it is ALWAYS opened EXCLUSIVE by definition, I wonder why it can't be PACKed?
>
>
>>You cannot PACK cursor. SET DELETED ON should take care. The deleted records still be there but VFP'll ignore them.
--sb--
Previous
Responder
Mapa
Ver

Click here to load this message in the networking platform