|
|
|
|
|
|
|
|
|
|
HStatCalculateAsynchronous (Function) In french: HStatCalculeAsynchrone
Available only with this kind of connection
Gets various statistics on the keys of an HFSQL Client/Server data file. These statistics are used when applying a filter, creating a query or creating a view on the data file. The HFSQL engine analyzes the selection condition, then uses these statistics to define the most discriminating items that will be used to optimize iterations on data files. The statistics are used to get information about the content of the data file when they are calculated. Also, the more modifications there are to the data file after this calculation, the less accurately these statistics represent the contents of the data file. The more records the data file contains, the less the modification of a single record impacts the overall statistics. Reminder: HStatCalculate prevents writing to the data file while statistics are being calculated. By using HStatCalculateAsynchronous, you can complete this process in a background task, without blocking the application. Note: For optimal results, this calculation must include all data files (e.g. multi-file query). DatabaseConnection is Connection
FileArray is array of hFileParameter
MyFileParam is hFileParameter
MyFileParam.Name = "AvailableAction"
ArrayAdd(FileArray, MyFileParam)
IF bBackgroundTask THEN
HStatCalculateAsynchronous(DatabaseConnection, FileArray, hBackgroundTask, Callback_HStatCalculateAsynchronous)
ELSE
HStatCalculateAsynchronous(DatabaseConnection, FileArray, Callback_HStatCalculateAsynchronous)
END
INTERNAL PROCEDURE Callback_HStatCalculateAsynchronous(MyFile is string, MyResult is boolean)
IF MyResult THEN
Trace("Statistics calculated for the data file " + MyFile)
ELSE
Trace("Unable to calculate statistics for the data file " + MyFile + ErrorInfo())
END
END
Syntax
<Result> = HStatCalculateAsynchronous(<Connection> , <Data files to check> [, <Option>] [, <WLanguage procedure>])
<Result>: Boolean - True if statistics are being calculated,
- False otherwise.
<Connection>: String or Connection variable Connection to the server containing the data files to be manipulated. This connection corresponds to: <Data files to check>: Array of hFileParameter variables Name of the array of hFileParameter variables corresponding to the list of data files to be processed. <Option>: Optional integer Option for calculating the statistics. - If this parameter is not specified, the calculation of statistics locks the data file.
- If this parameter is set to the hBackgroundTask constant, statistics are calculated in the background, without locking the data file.
<WLanguage procedure>: Optional procedure name Name of the WLanguage procedure ("callback") called for each data file processed. This procedure is used to manipulate the current data file. Business / UI classification: Business Logic
Minimum version required
- Version 2025 (Subscription)
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|