Cleaning out Bad Data
This option is only relevant for the Embedded database.
Special Note
If duplicate rows are found in a re-index process with the same data in columns that should have unique values in every row, a file containing details of those duplicate rows can be requested. This option uses that file (which has the same root name as the table and the extension .BAD) to allow you to point and select the row to be kept and to delete all the other duplicates.
To initiate the cleaning process, select Cleanup from the Maintenance menu. This pops up a file-selection panel.
- First, the files to clean up must be selected. Provided there are duplicate rows in a
.BADfile in the current directory for that file, you will see a screen with four boxes: - Select row to keep
- Row To Keep
- Current Row
- Delete status
If the .BAD file does not exist, you will see an error message.
-
The row numbers of the first set of duplicate rows are shown in the Select row to keep list, and the first of those row numbers is marked (meaning it is the present Row To Keep). Its number is noted in the form labeled Keeping:, and details of its columns are displayed in the Row To Keep box. The total number of duplicate rows in that set is noted in the form labeled Duplicates:.
-
The selection cursor starts out on the row number of the first duplicate (the next row with the same key data). Details of its columns are displayed in the Current Row panel.
-
If there are too many columns to display at once, you can press the PGUP and PGDN keys to scroll the row-panel displays.
-
As you move the selection cursor down the list of duplicates, the Current Row panel changes to reflect the details of the row under the cursor, but the mark doesn't move. To select a different row as the Row To Keep, move the selection cursor to its row number in the Select Rows to Keep column and press the spacebar. That row number will be marked, and the Row To Keep panel will change to contain the details for that row.
-
Press OK to start the deletion process for the current duplicates. All duplicates except the one marked as the Row To Keep will be deleted. The same routine will be repeated for the next row that has any duplicates, so you may continue with this process until all the duplicates in the file have been deleted.
-
Press Skip to skip the current set of duplicates without deleting any of them and move to the next.
-
Press Auto to automatically delete all but the first row in all sets of duplicates.
-
Press Exit to exit the cleanup function.
-
If the process has not been completed (a row in the
.BADfile still has a duplicate), you will see a warning message that the table is unusable until the process is completed. -
When Cleanup has finished, the
.BADfile is deleted.