AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Automatic management of composite keys
  • Filter and filtered iteration
  • Enabling/Disabling a filter
  • Data file not in HFSQL format
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
Defines and enables a filter used to find the exact value of a string item. This filter can be used on a data file, a view or a query.
After its execution, the most common cases are as follows:
  • the filter cannot be created: the function HFilterIdentical FUNCTION function returns an empty string (""). HError returns the error identifier.
  • the filter is created: the HFilterIdentical function returns the optimal route key to be used to route the data file, view or query.
Ejemplo
// Select all the customers whose last name is Archambault 
// and whose first name is Colin
SearchKey is string
SearchKey = HFilterIdentical(Customer, LastNameFirstName, "Archambault", "Colin")
HReadFirst(Customer, SearchKey)
WHILE NOT HOut()
	Trace(Customer.CustomerName, Customer.City)
	HReadNext(Customer, SearchKey)
END
// Disables the filter
HDeactivateFilter(Customer)
Sintaxis
<Result> = HFilterIdentical(<Data file> , <Key item> , <Value for key component 1> [, <Value for key component 2> [... [, <Value for key component N>]]])
<Result>: Character string
Browse item. Corresponds to:
  • the search key of data file if the filter is enabled.
  • an empty string ("") if the filter cannot be implemented.
<Data file>: Character string
Name of the HFSQL data file, view or query used.
<Key item>: Character string
Name of key item onto which the filter will be applied. This item can be a simple key (string) or a composite key. Warning: this parameter must only contain letters, underlined characters or numbers.. Otherwise, the name must be enclosed in quotes.
<Value for key component 1>: Type of each component of the search key
Value sought for the first component of composite key.
The type of this parameter must correspond to the type of key item component on which the filter is defined.
<Value for key component 2>: Type of each component of the search key
Value sought for the second component of the composite key.
The type of this parameter must correspond to the type of key item component on which the filter is defined.
<Value for key component N>: Type of each component of the search key
Value sought for component N of composite key .
The type of this parameter must correspond to the type of key item component on which the filter is defined.
Observaciones

Automatic management of composite keys

HFilterIdentical automatically manages the filters on the simple keys and on the composite keys.
Example: Using HFilterIdentical with a simple key:
Res = HFilterIdentical(Customer, LastName, "Archambault")
// Select the customer whose last name is Archambault
Example: Using HFilterIdentical with a composite key
Res = HFilterIdentical(Customer, LastNameFirstName, "Archambault", "Colin")
// Select all the customers whose last name is Archambault and 
// whose first name is Colin
This line of code is equivalent to:
HFilter(Customer, LastNameFirstName, ...
	HBuildKeyValue(Customer, LastNameFirstName, "Archambault", "Colin"), ...   
	HBuildKeyValue(Customer, LastNameFirstName, "Archambault", "Colin")

Filter and filtered iteration

After the call to HFilterIdentical, the iteration must be performed on the item returned by HFilterIdentical. The filter will be ignored if another item is used to loop through the data file.
When a filter is defined and enabled on a data file (view or query), all records read correspond to the filter. If there are no more records matching the filter during browsing:
  • HOut returns True.
  • the current record corresponds to the last record read with the filter.
For example:
On a filtered data file, after the function:the current record is:
HReadFirstthe first file record corresponding to the filter.
HReadLastthe last file record corresponding to the filter.
HReadNext (or HForward)the next record (or the next nth record) corresponding to the filter.
HReadPrevious (or HBackward)the previous record (or the previous nth record) corresponding to the filter.

Enabling/Disabling a filter

  • HDeactivateFilter is used to disable a filter.
  • HActivateFilter is used to re-enable a filter.
  • The filter is deleted when the data file (query or view) is closed (HClose or HOpenAnalysis for example).
  • A single filter can exist at a given time on a data file (query or view). If the HFilterIdentical is used several times, only the last filter will be taken into account: the previous filter(s) will be deleted. Similarly, if several filters are used (HFilter* functions), only the last filter will be taken into account.
AndroidWidget Android Procedimientos almacenadosConectores Nativos

Data file not in HFSQL format

Componente: wd300hf.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

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