AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Conditions for using <Fuente>.FreeQuery
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Frees the resources of a query (after the call to <Source>.ExecuteQuery or <Source>.ExecuteSQLQuery).
Note: This function is based on the <Source>.CancelDeclaration function..
When to use <Fuente>.FreeQuery?
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.
Ejemplo
// Initializes the query
IF MyQuery.ExecuteQuery() = False THEN
Error("Error while initializing the query" + CR + HErrorInfo())
RETURN
END
 
// Read the first record of the query
MyQuery.ReadFirst()
WHILE NOT MyQuery.Out()
// Process on the query record
...
// Read the next record
MyQuery.ReadNext()
END
MyQuery.FreeQuery()
Sintaxis
<Result> = <Source>.FreeQuery()
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurs. HError is used to identify the error.
<Source>: Type corresponding to the specified source
Name of a query or a data source associated with a query (for freeing resources after the call to <Source>.ExecuteQuery or <Source>.ExecuteSQLQuery).
Observaciones

Conditions for using <Fuente>.FreeQuery

This function must be used ONLY when the query is not required anymore!
In the following example, function <Fuente>.FreeQuery is used too early: the table will be completely distorted. The Table control is populated using BuildBrowsingTable in a parallel process in the background. Therefore, <Fuente>.FreeQuery will operate before the Table control is entirely filled, making this control unusable.
Test.ExecuteSQLQuery("select * from customer")
BuildBrowsingTable(TABLE_Table1, "test")
Test.FreeQuery()

Note The problem can also occur with a variable of type "data source". 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 if you use this type of data source: "the data source will be destroyed at the end of this code".
Componente: wd300hf.dll
Versión mínima requerida
  • Versión 25
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 25/03/2025

Señalar un error o enviar una sugerencia | Ayuda local