AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Generic search/Exact-match search
  • Space characters at the end of item
  • Performing a search on a composite key
  • Search on an array item
  • Search and filter
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
The number of the current record is modified only when it is returned by <Source>.RecNum. For functions handling the current record number by default (functions <Source>.Delete, <Source>.Read, <Source>.Modify, ...), the value of this number is not updated: you must use the <Source>.RecNum() function. For example: do not:
Customer.Delete()
but
Customer.Delete(Customer.RecNum())
// Generic search for the first record for which 
// the postal code starts with "75"
Customer.Seek(ZC, "75")
Ejemplo
// Exact-match search for the first record
// for which the Customer name is Moore
// Mode 7: Text field terminated by Caract(0)
Customer.Seek(Name, "Moore" + Charact(0))

// Mode 5.5: Text field completed with spaces
Customer.Seek(Name, Complete("Moore", 30))
Sintaxis
<Result> = <Source>.Search(<Key item> , <Search value> [, <Options>])
<Result>: Booleano
  • True if the position was set,
  • False in the event of an error (blocking, etc.): the Record is not played. This problem can be caused by:
    • or a positioning problem (empty data file, etc.): function <Source>.Found returns False and function HError returns 0.
    • an error: HError returns an integer other than 0. HErrorInfo returns more details.
<Source>: Tipo de fuente especificada
Name of the HFSQL data file used.
<Key item>: Cadena de caracteres
Name of key item on which the search will be performed.
<Search value>: Tipo de valor
Value of the sought item.
<Options>: Constante o combinación de constantes opcional
Configures:
  • the lock mode applied to the sought record.
  • the type of iteration
  • the type of search performed.
hIdenticalExact-match search (see the Notes).
A generic search is performed by default (parameter not specified).
hKeepFilterThe filter set by <Source>.Filter will be taken into account, even if the search key is not optimized for the filter. Reminder: <Source>.Filter returns the optimized search key for the filter.
Warning: in this case, on large data files, performance problems may occur..
Hyper File 5.5 This variable cannot be used.
hLimitParsingThe iteration will stop when the last searched value is found. The current record will correspond to the record found. In this case, <Source>.Found returns False and <Source>.Out returns True.
This constant is used to optimize the speed in Client/Server mode.
hLockNoNo blocking: the Record can be played back or modified by another application during playback.
hLockReadWriteRead/write lock: the record being read cannot be read or modified by another application.
OLE DB Lock in write-only. Operating mode equivalent to the hLockWrite constant.
hLockWriteWrite lock: the record currently read can be read by another application but it cannot be modified by another application.
Java Access through JDBC: This parameter is ignored.
OLE DBConectores Nativos The lock options will have no effect if the locks are not supported by the OLE DB provider or by the Native Connector.
Hyper File 5.5 The lock options are ignored. Use locking read functions (HReadFirstLock) kept for backward compatibility.
Observaciones

Generic search/Exact-match search

A generic search or an exact-match search will be performed according to <Sought value>.
  • Generic search: searches for all records beginning with the specified value
    To perform a generic search, the desired value must be specified in <Sought value>.
  • Case of exact-match search In the case of an identical search: searches for all records corresponding exactly to the specified value.
    To perform an exact-match search, the size of the search argument must be exactly the same as the size of the key. The search argument must be filled with "space" characters for the text keys. To do so, use the <ANSI string>.Complete function.

Space characters at the end of item

By default, when a record is read, trailing spaces in text fields are not removed from variables associated with the data file.
In order for the space characters to be deleted, use WithSpace.

Performing a search on a composite key

Several methods can be used to perform a search on a composite key:
Using a list of values
The following syntax is used to perform a search on a composite key:
HSeek(<File name>, <Name of composite key>, ...
[<Search value of first element of composite key>,
<Search value of first element of composite key>, ...])
Example:
// Find the record
Customer.Seek(LastName_FirstName, ["MOORE","Vince"])
Hyper File 5.5 To perform generic searches on a composite key, all the components of composite key must be Text components. Otherwise, an exact-match search is performed.

Search on an array item

The search is performed on the first array element (element with index 1). To perform a search on the other array elements, use the filters or queries.

Search and filter

If a filter is enabled (<Source>.Filter), this filter is taken into account during the search.
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: 22/11/2024

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