ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Data model editor
  • Overview
  • Consistency for a data file
  • Consistency between several data files
  • Shared link
  • Complex link
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Key and referential integrity
Overview
In an analysis, the "Key" items are also used to manage the consistency of data (called referential integrity):
  • consistency for a data file.
  • consistency between several data files.
Consistency for a data file
The consistency of the records found in a data file is defined via the unique keys.
For example, in a PRODUCT data file, the reference of the product must be unique: each record must correspond to a different product, identified by its reference.
To do so, the REFERENCE item must be defined as unique key.
Consistency between several data files
The consistency between several data files is defined via the links. The main types of links are:

Shared link

A record can be associated with several records of another data file.
Example: A SUPPLIER distributes several ITEMS, but each ITEM is associated with a single SUPPLIER.
To manage the referential integrity in this type of link, the unique identifier of SUPPLIER must be included in the ITEM data file (this operation is automatically performed in the data model editor).
Shared link
The referential integrity check makes sure that:
  • the SUPPLIER exists for every new ITEM
  • all the items associated with a supplier are deleted when the supplier is deleted.
Advanced rules can also be defined:
  • cascading deletion: in this case, when a supplier is deleted, all associated items are deleted.
  • cascading modification: all the linked records are modified in cascade when the key item (automatic identifier or other) is modified in the source file.

Complex link

Several records of a data file can be associated with several records of another data file (and conversely).
Example: An order can contain several products and each product can be used in several orders.
In this case, a relation file must be created. This file contains the unique key of each data file that must be linked (as well as other information if necessary).
The complex link becomes a set of shared links.
Complex link
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/20/2023

Send a report | Local help