|
Hi Jim
When I have exclusive access to a file and can do a CPYF *REPLACE
one method I use to drop duplicate records is create a temporary file
using
CREATE TABLE xxx LIKE yyy
INSERT into xxx (SELECT DISTINCT * from yyy WHERE etc)
DELETE FROM yyy
INSERT into yyy SELECT * from xxx
or replace the DELETE and INSERT with
CPYF xxx yyy MBROPT(*REPLACE)
This assumes you dont care which of the duplicates is removed.
If you need to remove a particular duplicate then this is not the way.
Regards
Frank Kolmann
Fri, 9 Jan 2009 10:50:21 -0600and have not played one on TV).
from: "Jim Lowary"
subject: Using SQLRPGLE to find Dup Records and do Delete?
I have a program that is written in SQLRPGLE to find dup records in a
large file (below is the mainline and select routine). Can I get the
RRN of the record from the fetch of the SQL record? If so I can do a
delete that way.
I'd appreciate any help or suggestions (as I'm not much of an SQL >person
Thanks,
-- Jim Lowary
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.