ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Displaying the result in a List Box or Combo Box control
  • Extracting information from the result
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns the list of keys in a data file (query or view) recognized by the HFSQL engine. You can determine:
  • the type of key,
  • its size,
  • whether the key is unique or with duplicates, etc.
The files defined by HDeclare, HDeclareExternal and HDescribeFile are taken into account.
// Récupérer les clés d'un fichier de données présent dans l'analyse en cours
ListeCle is string
ListeCle = HListKey(Client, hLstDetail)
// Ajoute la liste des clés dans COMBO_COMBO1
ListAdd(COMBO_COMBO1, ListeCle)
Syntax
<Result> = HListKey(<Data file> [, <Path of the WDD file> [, <Password of the WDD file> [, <Options>]]])
<Result>: Character string
List of items found in the specified data file. The different descriptions of each key are separated by CR characters (Carriage Return). The listed keys are sorted according to the physical order of the keys in the data file (except if the hLstSorted constant is used).
The result is more or less detailed depending on the constant used:
hLstDetail is not specified<Name of key 1> + CR + <Name of key 2 + CR + ...
The result is identical with hLstKey and/or hLstCompositeKey and/or hLstSorted.
hLstDetail is specified<Name of key 1> + TAB + <Type> + TAB+ <Size> + TAB + <Expression> + TAB + <Unique> + TAB + <Caption> + CR +...
hLstDetailPlus<Name of key 1> + TAB + <Type> + TAB + <Size> + TAB + <Expression> + TAB + <Unique> + TAB + <Caption> + TAB + <Integer part of numeric keys> + TAB + <Decimal part of numeric keys> + CR +...
Where:
  • <Nom de clé X> key name.
  • <Type> key type: "T" for text (and monetary) or "N" for numeric.
  • <Taille>: column size.
  • <Formule>: key formula if the key is compound (if the key is simple, only the key name is returned).
  • <Unique>:
    • "2" for primary keys.
    • "1" for a unique key,
    • "0" for a key with duplicates.
  • <Libellé>: key label.
  • <Partie entière des clés numériques> number of digits in the integer part of numeric keys.
  • <Partie décimale des clés numériques> number of digits in the decimal part of numeric keys.
<Data file>: Character string
Name of data file (query or view) whose keys will be listed.
If a query name is specified, the query must be running (HExecuteQuery or HExecuteSQLQuery) to use HListKey. Otherwise, a WLanguage error occurs.
<Path of the WDD file>: Optional character string
Full path of the analysis (i.e. the .WDD file) in which the data file has been defined.
If this parameter is not specified or is an empty string (""), the data file is searched for in the current analysis.
<Password of the WDD file>: Optional string or Secret string
Password defined for the analysis.
If no password is defined, this parameter must be an empty string ("").
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
<Options>: Optional Integer constant (or combination of constants)
Type of list to perform:
hLstAllLists all the keys (hLstKey + hLstCompositeKey).
Hyper File 5.5 This constant is ignored.
hLstCompositeKeyLists the composite key items only.
Hyper File 5.5 This constant is ignored.
hLstDetailDetailed information (idem WINDEV 5.5).
hLstDetailPlusFor the numeric keys, add the number of digits found in the integer part and in the decimal part.
Hyper File 5.5 This constant is ignored.
hLstKeyLists the key items (non-composite keys only).
Hyper File 5.5 This constant is ignored.
hLstLogicalOrderSorts the list in logical order of items (ignored if hLstSorted is specified).
Hyper File 5.5 This constant is ignored.
hLstNormal
(default value)
Corresponds to hLstAll. Value used by default if the hLstKey, hLstCompositeKey and hLstAll constants are not used.
hLstOriginalItemUsed on a log file (xxxJNL.fic), lists the keys of the initial source file (that was logged). For example, on CustomerJNL.Fic, list the key items of CUSTOMER file.
Hyper File 5.5 This constant is ignored.
hLstSortedSorts the list in ascending order.
Hyper File 5.5 This constant is ignored.
Remarks

Displaying the result in a List Box or Combo Box control

<Result> can be directly assigned to a List Box or Combo Box control by ListAdd. Each row will contain the name of one of the keys found.

Extracting information from the result

To extract information from the detailed result, it is recommended to use ExtractString.
Component: wd300hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help