PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Enabling the management of integrity
  • Disabling the integrity rules
  • In HFSQL Client/Server mode
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
Enables or disables the management of an integrity constraint on a file link.
Note: By default, all integrity rules defined in the analysis description are enabled. Note: From version 19, HFSQL is the new name of HyperFileSQL.
Example
// Disable the check for cardinalities on the link between an order and a customer
HSetIntegrity(CustomerOrder, hCardinality, False)
// Disable all integrity rules on all application files
HSetIntegrity("*", "*", hCardinality + hOnUpdate + hOnDelete, False)
// equivalent to: HSetIntegrity(False)
Syntax

Enabling or disabling the management of an integrity constraint by specifying the file name Hide the details

<Result> = HSetIntegrity([<Link to use>] [, <Data file>] [, <Integrity constraint>] , <Management mode>)
<Result>: Boolean
Former management mode of integrity (before the call to HSetIntegrity):
  • True if the management of integrity was enabled,
  • False if the management of integrity was disabled.
If <Link to use> = "*" or if <Data file> = "*", <Result> is set to True if the integrity was enabled for at least one link or for at least one data file in the former management mode of the integrity.
<Link to use>: Optional character string (with or without quotes)
Name of relevant link (name made of the different data files involved in the link).
If this name is not specified or if it is equal to "*", the new integrity management is applied to all links defined in the analysis.
<Data file>: Optional character string (with or without quotes)
Name of data file used.
If this parameter is not specified or of it is equal to "*", the new management is applied to all the data files involved in the link (including the aliases).
If <Link to use> corresponds to "*", this parameter must also correspond to "*". Indeed, you cannot enable or disable all the integrity constraints for all links found in a specific data file.
<Integrity constraint>: Optional Integer constant (or combination of constants)
Used to define the integrity constraints that must be managed. If this parameter is not specified, the new management mode is applied to all link constraints.
hCardinalityCheck the link cardinalities.
hOnUpdateIntegrity rule applied during a modification.
hOnDeleteIntegrity rule applied during a deletion.
<Management mode>: Boolean
  • True if the integrity constraint is enabled,
  • False if this management must be disabled. If only this parameter is specified, the management mode is applied to all data files.

Enabling or disabling the management of an integrity constraint by specifying the connection of data file Hide the details

<Result> = HSetIntegrity(<Source data file connection> [, <Linked data file connection>] , <Link description> [, <Integrity constraint>] , <Management mode>)
<Result>: Boolean
Former management mode of integrity (before the call to HSetIntegrity):
  • True if the management of integrity was enabled,
  • False if the management of integrity was disabled.
<Source data file connection>: Character string (with or without quotes)
Name of connection to which belongs the source data file of link. This connection was defined in the data model editor, or by HDescribeConnection or HOpenConnection.
<Linked data file connection>: Optional character string (with or without quotes)
Name of connection to which belongs the linked data file of link. This connection was defined in the data model editor, or by HDescribeConnection or HOpenConnection.
If this parameter is not specified, the two data files belong to the same connection (<Source Connection>).
<Link description>: Link description
Name of the "Link description" variable containing the link characteristics.
<Integrity constraint>: Optional Integer constant (or combination of constants)
Integrity constraints that must be managed. If this parameter is not specified, the new management mode is applied to all link constraints.
hCardinalityCheck the link cardinalities.
hOnUpdateIntegrity rule applied during a modification.
hOnDeleteIntegrity rule applied during a deletion.
<Management mode>: Boolean
  • True if the integrity constraint is enabled,
  • False if this management must be disabled. If only this parameter is specified, the management mode is applied to all data files.
Remarks

Enabling the management of integrity

If an operation performed on a data file triggers a violation of an integrity constraint on an active rule, the operation is not performed and provokes the error of the function. In this case, HErrorIntegrity returns True.
Note: Only HAdd, HModify, HDelete, HCross and HWrite can generate an integrity error.

Disabling the integrity rules

Disabling an integrity rule means the possibility not to comply with the constraints specified during the description of the data files in the data model editor. Therefore, disabling an integrity rule should be done with great care: it must be used advisedly.
WEBDEV - Server codeHFSQL Client/Server

In HFSQL Client/Server mode

Using the HSetIntegrity(<Management>) syntax affects the behavior of all HFSQL servers (no matter whether the connection is opened before or after the call to HSetIntegrity).
Using HSetIntegrity by specifying the link name can be done if:
  • The link is described in the client analysis (or by HDescribeLink).
  • The two data files linked by this link are found on the same HFSQL server.
If HSetIntegrity is called before the data files are in Client/Server mode (if HChangeConnection is used for example), the server enables the integrity rule.
Rights are associated with the management of integrity on the database: hRightsManageIntegrity. An error occurs when the user tries not to comply with the integrity constraint (when using HAdd, HModify, ...).
Component : wd240hf.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment