|
|
|
|
|
HSuggestKey (Function) In french: HSuggèreClé Returns a list of keys to add to data files to improve query performance. sMyString is string sMyString = HSuggestKey(MyConnection, ((MyQuery1, MyQuery2, MyQuery3)) Trace(sMyString)
Syntax
<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>) where: - <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 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> where: - <File N> is the data file to be optimized.
- <Key N> is the name of the key to be added.
|
Remarks - 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 = [ SELECT * FROM PRODUCT 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
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|