[progress Communities] [progress Openedge Abl] Forum Post: Re: Removing Duplicates From A Table

Status
Not open for further replies.
M

marian.edu

Guest
There can be many ways to find a ‘duplicate’ once one is able to define what a duplicate means, Patrick’s break-by approach can work - probably audit fields need to be excluded as well (create, last update, user) and I imagine it might have issues with ‘large objects’ but the idea is there… however, I would not simply delete the ‘duplicate’ like that as it’s PK might be used in child tables (FK) and that could make a mess out of the database :( So, there hardly is a code snippet for this but coding it once you have the requirements should not be difficult: - define the criteria for ‘duplicate’ identification - decide which of the dupes to keep (some timestamp field maybe) - for each dupes to be deleted go through the child tables and update the PK to point to the ‘winner’ and only then delete the dupe Marian Edu Acorn IT www.acorn-it.com www.akera.io +40 740 036 212

Continue reading...
 
Status
Not open for further replies.
Top