PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Management of duplicates enabled
  • Generalizing the check for duplicates
  • Disabling the check for duplicates
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
HSetDuplicates (Function)
In French: HGèreDoublon
HFSQLHFSQL Client/ServerAvailable only with these kinds of connection
Enables or disables the management of duplicates on a unique key.
Notes:
  • The management of duplicates is enabled by default.
  • This function is not available on the databases accessed by OLE DB or by Native Accesses.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 22 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Java This function is now available for the Java applications.
New in version 22
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Java This function is now available for the Java applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Java This function is now available for the Java applications.
Example
// Disables the management of duplicates on Customer file for the "Name" key
HSetDuplicates(Customer, Name, False)
Syntax
<Result> = HSetDuplicates([<File Name> , [ <Item Name>] , ] <Options>)
<Result>: Boolean
Former management mode of duplicates (before the call to HSetDuplicates):
  • True if the management of duplicates was enabled,
  • False if the management of duplicates was disabled (or if the specified key is a key with duplicates).
If <Item Name> = "*", <Result> is set to True if the check for duplicates was enabled for at least one item in the former management mode of duplicates.
<File Name>: Optional character string (with or without quotes)
Name of data file used.
If this parameter is not specified or if it corresponds to "*", the management of duplicates is taken into account for all the data files found in the analysis.
<Item Name>: Optional character string (with or without quotes)
Name of unique key item used.
If this parameter is not specified or if it corresponds to "*", the management of duplicates is taken into account for all the key items found in the specified file.
<Options>: Boolean
  • True if the management of duplicates must be enabled on the item,
  • False if this management must be disabled. If only this parameter is specified, the management mode is applied to all the items of all the data files.
Remarks

Management of duplicates enabled

If the management of duplicates is enabled on a key defined as unique key, the uniqueness is automatically checked whenever a record is added or modified in the data file.
Therefore, if the uniqueness is not checked during an addition (HAdd) or a modification (HModify), the record is not added (or modified), the addition function (or the modification function) returns an error and HErrorDuplicates returns True.
Note: Only HAdd and HModify can generate a duplicate error.

Generalizing the check for duplicates

  • To generalize the management mode of duplicates to all the items found in a data file, use the meta-character "*".
    For example:
    HSetDuplicates(<File Name>, "*", <Option>)
  • To generalize the management mode of duplicates to all the items found in all the data files, you must use the meta-character "*".
    For example:
    HSetDuplicates("*", "*", <Options>)
  • If only <Option> is specified, the management mode is applied to all the data files and to all the items.

Disabling the check for duplicates

Disabling the check for duplicates means the possibility not to comply with the uniqueness rules specified during the description of the data files in the data model editor. Therefore, disabling the check for duplicates must be done with great care: it must be used advisedly.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment