|
|
|
|
|
- Generic search/Exact-match search
- Exact-match search in Access
- Performing a search on a composite key
- Search on an array item
- Search and filter
- Looping through records that match a condition
- Optimizing iterations
<Source>.ReadSeek (Función)
No disponible con este tipo de conexión
Positions on the first file record whose value for a specific item is greater than or equal to a sought value (generic search). The record is read and the corresponding HFSQL variables are updated. In most cases, <Source>.ReadSeek sets the position in the data file to loop through the records that match a condition. <Source>.ReadNext is used to read the next record corresponding to the condition.Several cases may occur after the call to <Source>.ReadSeek: - a Record corresponding to the condition has been found, blocked (if necessary) and loaded into memory: function <Source>.Found returns True.
JDBC access: lock management is not supported for databases that are accessed through JDBC. - the data file is empty or there is no record corresponding to the condition: no read is performed and function <Source>.Out returns True.
This function can be used with the data files, HFSQL views or queries. Remarks: - By default, <Source>.ReadSeekFirst and <Source>.ReadSeekLast are used to perform exact-match searches.
- By default, <Source>.ReadSeek is used to perform a generic search on strings. This search is not generic on integers, reals, dates, currencies, etc.
Client.LitRecherche(Nom, "DUPOND")
IF Client.Trouve() THEN
Trace("Client DUPOND trouvé")
ELSE
Trace("Client DUPOND non trouvé")
END
Sintaxis
<Result> = <Source>.ReadSeek(<Item> , <Search value> [, <Options>])
<Result>: Booleano (opcional) Corresponds to: - True if the sought record was found and read. The file buffer is loaded with the data of the record found. In this case, HError is set to 0 and <Source>.Found is set to True.
- False in the following cases:
- error while accessing the file (unable to read for example). HError returns an error code. HErrorInfo returns more details about the error. In this case, <Source>.Found cannot be used.
- the access to the file was performed but no record was found. In this case, HError is set to 0 and <Source>.Found is set to False.
Warning: In this case, the file buffer cannot be used..
<Source>: Tipo de fuente especificada Name of data file, HFSQL view or query used. <Item>: Cadena de caracteres Name of item on which the search will be performed. For an exact-match search, this parameter can correspond to a non-key item.
<Search value>: Tipo de valor Value of the sought item. <Options>: Constante o combinación de constantes opcional Used to configure:- the lock mode applied to the sought record.
- the type of search performed.
| | hIdentical | Exact-match search (see the Notes) A generic search is performed by default (constant not specified).
| hKeepFilter | The 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. Caution: in this case, on large data files, performance problems may occur..
| hLimitParsing | | hLockNo | No blocking: the Record can be played back or modified by another application during playback.
| hLockReadWrite | Read/write lock: the record being read cannot be read or modified by another application. The lock mode is ignored if a query is used.
| hLockWrite | Write lock: the record currently read can be read by another application but it cannot be modified by another application. The lock mode is ignored if a query is used. | hNoRefresh | |
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|