duplication check over a combination of fields?

Linksaussen_11

New member
Hello all,

I wonder how the "Check for duplicated entries during INSERT?" works. As I understand
the function only checks every single field, but not a combination of i.e. three fields
When I set all of them to yes, the system suggests two much data sets,
which a far away from the inserted one.
Is it possible to make duplication check over a combination of fields?

Regards
Thilo




You are using DaDaBIK version 5.1.2 PRO, installed on 04-10-2013, the last version of DaDaBIK is 5.1.2 released on 23-07-2013
You are runnning the last release of DaDaBIK
PHP Version: 5.3.1
mysql version: 5.1.41-log
Web server: Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
Client: Mozilla/5.0 (Windows NT 6.1; rv:25.0) Gecko/20100101 Firefox/25.0
 

eugenio

Administrator
Staff member
Hello,
the function not only check each field value inserted with the correspondent values in the database but also perform a cross check with other fields for which you enable the duplication checking. E.g. if you have a table customers with two fields first_name and last_name (both enabled for duplication checking) and you insert "john" and "smith", DaDaBIK will check "john" against first_name and last_name values, and will check "smith" against first_name and last_name values. This could be useful for example if the user who performs data-entry entered first and last name in the wrong order by mistake.
 

Stephan-H

Member
DaDaBIK version 11.12-Elba enterprise

I have a table with the fields COUNTRY and RIVER. There are rivers that flow through more than one country, e.g. Donau (Austria, Germany...).

If I just enable "Check for duplicated entries during INSERT" for the field RIVER, it warns me when I'm about to enter "Donau" in combination with "Germany" when there is already an entry "Donau" in combination with "Austria".

To prevent that, I'd like to have the "Check for duplicated entries" performed for the COUNTRY + RIVER combination, but not as described by Eugenio above. The check should warn only if the exact combination of field values is already present in the table.

Could that be achieved by a custom validation function? If yes, how?

Thanks,
Stephan
 
Top