PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Performs various statistical calculations on the file keys.
Versions 16 and later
This function is equivalent to HAccelerateSpeed.
New in version 16
This function is equivalent to HAccelerateSpeed.
This function is equivalent to HAccelerateSpeed.
These statistics are used when implementing a filter, creating a query or creating a view on the data file. The HFSQL engine analyzes the selection condition then it is using these statistics to define the most discriminating items that will be used to optimize the browse operations performed on the data files.
The statistics are used to get information about the content of the data file when they are calculated. Therefore, the more modifications are performed in the file after this calculation, the less these statistics represent the true content of the data file. The more records the data file contains, the less the modification of a single record impacts the overall statistics.
Caution: HStatCalculate locks the data file in write mode while the statistics are calculated (a file browse is performed for each file key).
HFSQL Client/Server The statistics can be calculated in background task without locking the data file in write mode.
Note: In order for the statistical calculation to be efficient, this calculation must be performed on all data files (for a multi-file query for example).
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server code This function is now available to perform statistical calculations on the data files of a HFSQL cluster.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server code This function is now available to perform statistical calculations on the data files of a HFSQL cluster.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
WINDEVWEBDEV - Server code This function is now available to perform statistical calculations on the data files of a HFSQL cluster.
Versions 22 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
New in version 22
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
Example
// Statistics on CUSTNAME key of CUSTOMER file
HStatCalculate(CUSTOMER, CUSTNAME)
Syntax
<Result> = HStatCalculate([<File Name> [, <Name of Key Item> [, <Option>]]])
<Result>: Boolean
  • True if the calculation was performed,
  • False if a problem occurred (data file locked by an application for example). HError is used to identify the error.
<File Name>: Optional character string (with or without quotes)
Name of data file used. If this name is not specified, HStatCalculate handles the last data file used by the last function for HFSQL management (starting with the letter H).
If this parameter is equal to "*" (without specifying any item), the calculation will be performed on all data files described in the current analysis (including the data files described by HDeclare, HDeclareExternal, HDescribeFile).
Caution: This data file must not be locked by an application.
<Name of Key Item>: Optional character string (with or without quotes)
Name of key item used to perform the statistical calculation. If this name is not specified or if it is equal to "*", the statistics will be calculated for all key items found in the data file.
<Option>: Integer constant
Versions 15 and later
Option for calculating the statistics.
  • If this parameter is not specified, the calculation of statistics locks the data file in write mode.
  • If this parameter corresponds to the hBackgroundTask constant, the statistics are calculated in background task, without locking the data file.
Important: This parameter is taken into account for the HFSQL Client/Server files. In the other cases, the data file is automatically locked while the statistics are calculated.
New in version 15
Option for calculating the statistics.
  • If this parameter is not specified, the calculation of statistics locks the data file in write mode.
  • If this parameter corresponds to the hBackgroundTask constant, the statistics are calculated in background task, without locking the data file.
Important: This parameter is taken into account for the HFSQL Client/Server files. In the other cases, the data file is automatically locked while the statistics are calculated.
Option for calculating the statistics.
  • If this parameter is not specified, the calculation of statistics locks the data file in write mode.
  • If this parameter corresponds to the hBackgroundTask constant, the statistics are calculated in background task, without locking the data file.
Important: This parameter is taken into account for the HFSQL Client/Server files. In the other cases, the data file is automatically locked while the statistics are calculated.
Remarks
  • HStatCalculate does not close the data file.
  • The statistics can also be updated by HIndex. HIndex and HStatCalculate can both be used to update the file statistics.
  • In the HFSQL Classic or Client/Server data files, the statistical calculation can only be performed on the key items.
  • HStatCalculate(<File Name>) is equivalent to HStatCalculate(<File Name>, "*")
  • Versions 21 and later
    To use HStatCalculate with the data files of a HFSQL cluster, the <Option> parameter must correspond to the hBackgroundTask constant to avoid locking the cluster.
    New in version 21
    To use HStatCalculate with the data files of a HFSQL cluster, the <Option> parameter must correspond to the hBackgroundTask constant to avoid locking the cluster.
    To use HStatCalculate with the data files of a HFSQL cluster, the <Option> parameter must correspond to the hBackgroundTask constant to avoid locking the cluster.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment