PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

This content comes from an automatic translation.
  • Conditions of use of the HFreeQuery function
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
Frees the resources of a query (after the call to HExecuteQuery or HExecuteSQLQuery).
Remark: This function is based on HCancelDeclaration.
When using the HFreeQuery?
This function can be used when no other process will be using the result coming from a query. We recommend that you use this function on the queries that return an important number of lines (tens of thousands) in order to free the memory space.
Versions 17 and later
Java This function is now available for the Java applications.
New in version 17
Java This function is now available for the Java applications.
Java This function is now available for the Java applications.
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.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Example
// Initializes the query
IF HExecuteQuery(MyQuery) = False THEN
Error("Error while initializing the query" + CR + HErrorInfo())
RETURN
END
 
// Read the first record of the query
HReadFirst(MyQuery)
WHILE NOT HOut()
// Process on the query record
...
// Read the next record
HReadNext()
END
HFreeQuery(MyQuery)
Syntax
<Result> = HFreeQuery([<Request>])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HError is used to identify the error.
<Request>: Optional character string (with or without quotes)
Name of the request or a data source associated with a request (case of a release of resources following the use of the HExecuteQuery or HExecuteSQLQuery functions).
If this parameter is not specified, corresponds to the last data file used.
Remarks

Conditions of use of the HFreeQuery function

This function must be used ONLY when the query is not required anymore!
DIn the following example, the HFreeQuery function is used too early: the table will be completely wrong. Indeed, BuildBrowsingTable (used to fill the Table control) is run in background task in a parallel process. Therefore, HFreeQuery will operate before the Table control is entirely filled, making this control unusable.
HExecuteSQLQuery("test", "select * from customer")
BuildBrowsingTable(TABLE_Table1, "test")
HFreeQuery("test")
Remark: The problem can also occur with a "data source" variable. A "data source" variable declared locally in a process (button click, procedure, method, etc.) ONLY exists during the execution of this code. For this reason, a "warning" is displayed when you are using this type of data source: "the data source will be destroyed at the end of this code".
Component : wd250hf.dll
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment