Replace Column Contents
This dialog, opened via Alt+M or from the record pulldown, offers the user a very powerful function to replace the content of a particular column with another value. The use should be restrained to only those users that know what they are doing. The function is not available in end-user mode; dbAdminMode must be ON or DDB, and the table must be opened for read-write. Make sure that you can always go back to the previous situation, either via a backup or a copy of the database/table. The replace work is done within one transaction, and you need to confirm the operation at the end before the final work is done.
The replace column contents dialog respects the filters applied to the dataview. Only the records accessible with the current filters can be touched.
If you are working with a non-embedded database that supports SQL, you might want to use that for the substitute work. It will usually work faster.
Controls in the Dialog
The dialog has the following controls:
Column Name
This combo form shows the columns of the currently opened table. The current grid column is pre-selected as the column name to perform the actions on. You can select any column. Based on the data type, either the dates, numbers, or string group become available.
Dates
This group, only available if the data type of the selected column is DF_DATE, has two date forms in which you specify the date range for the replace operation. If you want to replace one date, you specify the same date value in the from and to input forms. The third input form in this group is used to enter the replacement date.
DateTime
This group, only available if the data type of the selected column is DF_DATETIME, has two datetime forms in which you specify the date and time range for the replace operation. If you want to replace one datetime, you specify the same datetime value in the from and to input forms. The third input form in this group is used to enter the replacement datetime value.
Numbers
In this group, you specify the numeric value that needs to be replaced by another numeric value. There is no range.
String
In this group, you specify the old and new string values. With the first of the two checkboxes, you specify whether an exact match is required or if the contains operation is used. Especially, the contains operation is very powerful, and you need to be fully aware of the potential harm you can cause. The second checkbox is used to indicate if a replaces() operation should be used.
Index
This combo form shows the indexes defined for the current table. You can choose to do the operation based on a particular index. The use of the right index can speed up or slow down the process of replacement. If the index matches with the filter defined, the record selection will be faster, but when you replace the value of one of the columns that make up the index, you will slow down the process since a reselect is necessary.
Status Panel
If the operation is expected to take more than a few seconds, you can choose to use a status panel to get informed about the progress. With the combo form in this group, you select the column value to be displayed on the status panel. Choose a column that changes in a sequential order during the update process; otherwise, you will still have no idea where the update process is.
Use a CLEAR Before Each Find
Checking this checkbox will slow down the process dramatically but will ensure you find and replace ALL occurrences. This is needed if you update a column that is part of the selected index.
Confirm Modify Operation at the End
This checkbox, by default selected, prompts you at the end of the update process with a question of whether you want to commit the changes or not. The number of changed records is shown, and if you select not to confirm, the whole operation is rolled back.