Mass undelete records in a DBF-file - SOLVED

Mass undelete records in a DBF-file - SOLVED

Postby driessen » Thu Mar 14, 2013 2:29 pm

A customer of mine deleted a few thousand records in a DBF-file.

They are still there of course but they are all marked as deleted.

How can I undelete all those records?

Thank you very much in advance for any help.
Last edited by driessen on Thu Mar 14, 2013 3:53 pm, edited 1 time in total.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1396
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Mass undelete records in a DBF-file

Postby Bayron » Thu Mar 14, 2013 2:36 pm

You have to use the RECALL command...

http://www.ousob.com/ng/53guide/ngd675b.php

EDITED: You have to test it, because I only see this documentation on Harbour:

http://www.fivetechsoft.com/harbour-docs/api.html#dbrecall
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: Mass undelete records in a DBF-file

Postby Bayron » Thu Mar 14, 2013 3:02 pm

Before you try anything, make sure you make a copy of the affected database...

If I understand correctly, dbRecall() recalls only the record where the pointer is at...

So you probably can try:

DBEVAL()

Performs a code block operation on the current Database

Syntax
DBEVAL( <bBlock>,
[<bFor>], [<bWhile>],
[<nNext>], [<nRecord>],
[<lRest>] ) --> NIL
Arguments
<bBlock> Operation that is to be performed

<bFor> Code block for the For condition

<bWhile> Code block for the WHILE condition

<nNext> Number of NEXT records to process

<nRecord> Record number to work on exactly

<lRest> Toggle to rewind record pointer
Returns
DBEVAL() always returns NIL

Description
Performs a code block operation on the current Database


I never had the need to recover any records, but you can start from there...
Please post your results, so we can learn from it...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: Mass undelete records in a DBF-file

Postby Enrico Maria Giordano » Thu Mar 14, 2013 3:45 pm

Bayron wrote:If I understand correctly, dbRecall() recalls only the record where the pointer is at...


No:

Code: Select all  Expand view
RECALL FOR condition


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8336
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Mass undelete records in a DBF-file - SOLVED

Postby driessen » Thu Mar 14, 2013 3:54 pm

Thanks a lot, guys.

Your help was all very helpful.

It was the first time I had to do that. And thanks to you all with succes.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1396
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Mass undelete records in a DBF-file - SOLVED

Postby Franklin Demont » Thu Mar 14, 2013 4:06 pm

Michel

All the indexes have to be rebuild , or when the dbf is packed the index should be active

Frank
test
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am

Re: Mass undelete records in a DBF-file - SOLVED

Postby Bayron » Thu Mar 14, 2013 4:09 pm

I am glad you succeeded...
Anyone's problems is a school for all of us...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 17 guests

cron