Help / WLanguage / Managing databases / HFSQL / HFSQL Client/Server functions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Returns a list of keys to add to data files to improve query performance.
sMyString is string
sMyString = HSuggestKey(MyConnection, ((MyQuery1, MyQuery2, MyQuery3))
<Result> = HSuggestKey(<Connection> , <Queries> [, <Options>])
<Result>: Character string
Message corresponding to the requested format.
<Connection>: Character string or Connection variable
Connection to the HFSQL server containing the queries to be analyzed. This connection corresponds to:
<Queries>: List of values enclosed in brackets and separated by commas
List of queries to be analyzed (10 queries maximum). This list of queries has the following format:
(<Query 1>, ..., <Query N>)
  • <Query 1>: First query to be analyzed.
  • ...
  • <Query N>: Nth query to be analyzed.
Remark: It is possible to analyze queries created with the query editor, WLanguage queries or SQL queries. The different types of queries can be mixed in the list.
<Options>: Integer constant
New in version 28
Allows you to configure the returned result:
hSKSimplified not specified
(Default value)
<Résultat> is a readable message for the developer, containing the list of keys to be added to the data files in order to optimize the queries. This text uses RTF.
hSKSimplified specified<Result> is the list of missing keys. If no key is needed, <Result> is an empty string. The list of missing keys has the following format:
<File 1> + TAB + <Key 1> + <EOT> + <Key 2> + ...
+ <Key N> + CR + ... + CR + <File N> + TAB + <Key 1> +
<EOT> + <Key 2> + ... + <Key N>
  • <File N> is the data file to be optimized.
  • <Key N> is the name of the key to be added.
  • The function takes a maximum of 10 queries as parameters. To accept more queries, it is recommended to use HSuggestKeyStart and HSuggestKeyEnd.
  • To analyze a query with a parameter, you must provide the value of the parameter before executing HSuggestKey. For example:
    MySELECT_PRODUCTqry is SQL Query =
    WHERE PRODUCT.Reference = {pReference}
    MySELECT_PRODUCTqry.pReference = 123
    let sListKey = HSuggestKey(MyConnection, (MySELECT_PRODUCTqry))

    If no value is given for the query parameter(s), the query condition will not be taken into account. In that case, no keys will be suggested.
  • Keys are suggested according to the data contained in the data file. If a data file contains no data, no key will be suggested.
Business / UI classification: Business Logic
Component: wd280hf.dll
Minimum version required
  • Version 26
This page is also available for…
Click [Add] to post a comment

Last update: 08/24/2022

Send a report | Local help