ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / HFSQL properties
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
KeyType (Property)
In french: TypeClé
HFSQL ClassicHFSQL Client/ServerAvailable only with these kinds of connection
The KeyType property is used to set the characteristics of a key item. You can:
  • Determine if an item is key for an item defined in the data model editor or through programming
  • Define a key item (when the item is described through programming).
Example
// Define the characteristics of the Orders.OrdID key
Orders.OrdID.KeyType = hUniqueKey
...
// Validate the data file description
HDescribeFile(Orders)
Syntax

Determining if an item is key Hide the details

<Characteristic> = <Data file>.<Item>.KeyType
<Characteristic>: Integer constant
The characteristics of an item are:
hDuplicatesKeyKey with duplicates. This item can have the same value for several data file records.
hNotAKeyThe item is not a key.
hPrimaryKeyPrimary key. The value assigned to this item will not be null and will only be in the data file.
hUniqueKeyUnique key. The value assigned to this item will be unique in the data file. No record in the file will have the same value for this item.
Remark: a unique key can contain Null values.
<Data file>: Character string
Name of the data file used. This name was defined in the data model editor or with the File Description type.
<Item>: Character string
Name of the item used. This name is defined in the data model editor or with the Item Description type.
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppiPhone/iPadIOS WidgetUser code (UMC)Ajax

Defining a key through programming Hide the details

<Item>.KeyType = <Key type>
<Item>: Character string
Name of the item used. This name is defined with the Item Description type.
<Key type>: Integer constant
The characteristics of a key can be:
hDuplicatesKeyKey with duplicates. This item can have the same value for several data file records.
hNotAKeyThe item is not a key.
hPrimaryKeyPrimary key. The value assigned to this item will not be null and will only be in the data file.
hUniqueKeyUnique key. The value assigned to this item will be unique in the data file. No record in the file will have the same value for this item.
Remark: a unique key can contain Null values.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/04/2024

Send a report | Local help