Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re-building of file

Status
Not open for further replies.

joshuaguilty

Programmer
Apr 26, 2005
81
CA
I have a table which was originally in sequence, somehow I have deleted some lines. After I discover I put (append) them back, but they show up at the bottom rather than on their original place.
Could someone tell me how I could re-build the table based on the original sequence?
Thanks.
 
It may not be necessary to have them physically located in the proper order. If you have something like a date/time field in your table you can create an index based on those fields.

Otherwise, take a look at the INSERT command.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Thanks for the suggestion. For reading only I could apply index for the sorting. But physically I would like to transfer the table (in original sequence) to another system. Therefore if anyone could share your experience by doing select .... from table1 using index1 .....insert into table2. (table1 and table2 have exact structure) Then table2 would be renamed to table1.
Thanks.
 
Make a backup or 2 backups before you start.
Use the SORT command which will create a new file sorted in the required order.Look up the syntax in the help files (F1 key). Name that sorted file as TEMPSORT.dbf
Delete all records in the original file using DELE ALL and PACK. Exclusive use of the file is required.

APPEND FROM tempsort.dbf.

This should preserve your index structures
Issue the REIDEX command



 
Thanks to ALLLLLLLLLLLLLLLLLLLLLLLLL!
We need more beer for new friends!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top