Subject | Re: [firebird-support] avoiding duplicates |
---|---|
Author | Florian Hector |
Post date | 2005-07-12T07:09:39Z |
Hi Max,
As Dave already pointed out, one can never be sure that there aren't two separate companies with the
same name, so preventing new records based on the mere fact that the new company has the same name
as one already in the database is calling for trouble.
Why don't you implement a selectable stored procedure with a soundex function on the name column.
After a user has typed in the company name of a new record, you call the SP with this name. If there
are records returned with a similar name, the application can inform the user that there are records
which appear to be the same as the one he/she is about to insert. The user can then decide to go
ahead with inserting the new record or cancel the work.
Florian
As Dave already pointed out, one can never be sure that there aren't two separate companies with the
same name, so preventing new records based on the mere fact that the new company has the same name
as one already in the database is calling for trouble.
Why don't you implement a selectable stored procedure with a soundex function on the name column.
After a user has typed in the company name of a new record, you call the SP with this name. If there
are records returned with a similar name, the application can inform the user that there are records
which appear to be the same as the one he/she is about to insert. The user can then decide to go
ahead with inserting the new record or cancel the work.
Florian