## Is it possible to SELECT deleted records?

Forum for DBF Commander discussing.

### Is it possible to SELECT deleted records?

I have a table that I would like to select the deleted records into another table. Is this possible? It seems, for example, that when I load the DBF file it shows deleted rows, but if I do select * from that table it does not (which is correct behavior). ...but now I'd like to extract the deleted records for analysis. Is that possible?
somethingsimil

Posts: 30
Joined: Tue Jul 08, 2014 6:05 pm

### Re: Is it possible to SELECT deleted records?

We were thinking about such feature to be implemented. It will be added in one of the next releases, if there would be requests from other users. For now, you can do as follows:
1. If the table doesn't have an unique ID - create it: add Integer field and fill it with RECNO() function, for instance.
2. SELECT all records to another table - you'll get all non-deleted records.
3. Restore all deleted records in the 1st table ('Edit -> Recall All'), then link these two tables by the ID field and select all records that presents in the 1st table, but missing in the 2nd one. You'll get deleted records from the 1st table.
Best regards,
Oleg Zhechkov

Posts: 113
Joined: Wed Apr 21, 2010 7:27 pm

### Re: Is it possible to SELECT deleted records?

Thanks, this is what I came up with as well.
somethingsimil

Posts: 30
Joined: Tue Jul 08, 2014 6:05 pm

### Re: Is it possible to SELECT deleted records?

We are now using DBF Commander in order to sync records from a foxpro application to a Web App using MS SQL server. It is critical to be able to identify deleted records in FoxPro db. Comparison method suggested above is sluggish and inelegant for huge files.
We would very much appreciate if you could implement this future the soonest possible. Please make it possible to happen through the command line too.

Thanks a lot,
Mike Kokolakis

Posts: 5
Joined: Thu Mar 12, 2015 5:29 pm

### Re: Is it possible to SELECT deleted records?

Hello Mike,
Possibility to select deleted records in a batch mode will be added in the next version.
Best regards,
Oleg Zhechkov

Posts: 113
Joined: Wed Apr 21, 2010 7:27 pm

### Re: Is it possible to SELECT deleted records?

Thanks a lot. Looking forward to the command line addition.

Mike Kokolakis

Posts: 5
Joined: Thu Mar 12, 2015 5:29 pm

### Re: Is it possible to SELECT deleted records?

Has it been added to the command line? I do not see it in the docs...
somethingsimil

Posts: 30
Joined: Tue Jul 08, 2014 6:05 pm

### Re: Is it possible to SELECT deleted records?

You can use EXECSCRIPT command for this purpose: http://dbf-software.com/execscript.html
Execute it as a regular SQL query:
Code: Select all
dbfcommander -q "EXECSCRIPT([SET DELETED OFF] + CHR(13) + [SELECT * FROM 'd:\sum_orders.dbf' WHERE DELETED() INTO TABLE 'd:\QueryDeleted.dbf'])"
Best regards,
Oleg Zhechkov