ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Exclusive WINDEV, WEBDEV and WINDEV Mobile Subscription (Update 2) new feature. See "Using new features exclusive to a subscription-based version in a project".
Help / WLanguage / Managing databases / HFSQL / HFSQL Client/Server functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
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).
Subscription-exclusive new feature
This function is only available in subscription-based versions, starting with WINDEV Suite 2025 - Update 2.
For more details, see Using new features exclusive to the subscription-based version of WINDEV Suite 2025.
Example
DatabaseConnection is Connection
FileArray is array of hFileParameter

MyFileParam is hFileParameter
MyFileParam.Name = "AvailableAction"
// MyFileParam.Password = ""
// The Option property is ignored
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.
For more details on this procedure, see Parameters of the procedure used by HStatCalculateAsynchronous.
Business / UI classification: Business Logic
Component: wd300hf.dll
Minimum version required
  • Version 2025 (Subscription)
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/07/2025

Send a report | Local help