General information
Category:
Coding, syntax & commands
>I would like some suggestions for writing some
>code to delete duplicate records that are created
>on append and insert.
>
I just read this thread, but I can't believe noone mentioned
the elegant technique by Grommes and Jinkerson in Foxtalk "The
Pros Talk"
They say to develop a unique match key as an index
(no unique field necessary). This way you can
re-evaluate and change your match key as required.
SET DELTED OFF
USE TableName EXCLUSIVE
DELETE ALL
INDEX ON &MatchKey UNIQUE TO TempIDXName COMPACT
RECALL ALL
CLOSE INDEX
These six commands will open and de-dup table "TableName"
based on any matchkey "&MatchKey", using temporary index
"TempIDXName". DELETE ALL marks all records for deletion,
The UNIQUE index creates a key for the first occurence of
each uniquey matchkey. RECALL ALL will recalls only
unique records since UNIQUE index is active.
SET DELETE on or PACK and you are ready to go.
This little technique gives me much joy.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only