A DB2 table exists that does not have a Unique index. There are duplicate rows on this table that need to be removed. How can the duplicates be changed so they can then be deleted?
Release :20.0
Component : RC/Update for DB2 for z/OS
From the DB2 Tools Main Menu, enter Option 3 RC/Update and Edit the table (E T). The RC/Edit Panel is shown.
The WHERE under 'Data Selection' can be used to return specific rows.
Prior to Editing the table data check the Update method is set as needed:
>>>>>>
The Update Method prompt indicates the editing method to be used to update the data. Valid options are:
S - Searched Update. Use when two or more people want to edit the same table at the same time. Also, use Searched
Update's SET command to make global changes to a column for all rows.
D - Searched Update. Same as S above, but may include an SQL ORDER BY on the SELECT cursor.
P - Positional Update. Use when there is NULL data, you want to lock the table, or you need to update duplicate rows individually.
searched-and-positional-methods
The data is shown and the column data can be changed, or the OPT option on the LEFT can be used to Copy, Delete, Insert, Move etc. for the row, a ? will give the options.
PF3 after the change to see a summary of fetches/updates/deletes/inserts, then ENTER to process.