- Read operation according to a key item or not
In french: <Source>.Recule
Not available with this kind of connection
Moves backward several records from the current position in the data file, according to a specified item.
The destination record is read and loaded in memory: the HFSQL variables are updated (Customer.Name for example, which means the Name item of Customer file).
Several cases may occur after the call to <Source>.Backward:
- no other record exists in the data file: function <Source>.Out returns True. No read operation is performed.
- the function tries to lock a record that is already locked in read-only: HErrorLock returns True and <Source>.Out returns True.
Management of locks not available in PHP.
Access by JDBC: The management of locks is not available for databases accessed by JDBC.
This function can be used with the data files, HFSQL views or queries.
// Recule jusqu'au 200ème enregistrement du fichier de données Client
// selon la clé NomCli
<Result> = <Source>.Backward([<Item> [, <Step> [, <Options>]]])
- True if the backward move was performed in the data file,
- False if an error occurred (lock, end of file, etc.): the record is not read. HError is used to identify the error.
<Source>: Type corresponding to the specified source
Name of data file, view or query used.
<Item>: Optional character string
Name of item according to which the browse is performed. If this name is not specified, function <Source>.Backward will handle the last of the data file field used by the last HFSQL maintenance function (function beginning with the letter H).
All the items used to move backward in the file are considered as being key items.
The <Step> parameter is mandatory if this parameter is not specified.
<Step>: Optional integer
Number of steps backward (which means number of records to browse). By default, <Step> = 1.
<Options>: Optional Integer constant (or combination of constants)
- the lock mode applied to the record read. By default, the lock performed corresponds to the current lock.
|hLockNo||No lock: the record can be read or modified by another application during the reading.|
|hLockWrite||Lock in write mode: the record currently read can be read by another application but it cannot be modified by another application.|
|hLockReadWrite||Lock in read/write: the record currently read cannot be read or modified by another application.|
The lock options will have no effect if the locks are not supported by the OLE DB provider or by the Native Connector.
- the management of duplicates during the browse. By default, all the duplicates are browsed.
|hDistinct||When a browse is performed on a key item, a single record is browsed if duplicates are found.|
<Options> is ignored.
<Options> is ignored.
Access by JDBC: <Options> is ignored.
Read operation according to a key item or not
If the item used is a key item:
- if the hDistinct constant is not enabled, <Source>.Backward moves backward of <Step> key values from the current position.
- if the hDistinct constant is enabled, <Source>.Backward moves backward of <Step> distinct key values from the current position. If duplicates are found, a single duplicate is read.
If the item used is not a key item:
- the hDistinct constant is not available,
- <Source>.Backward moves backward of <Step> active records from the current position.
The memos associated with the record can be automatically read (or not) when reading the record. The <Source>.SetMemo
function allows you to customize this automatic reading.
If the memos are supported, the associated text memos are read when the record is read. The binary memos are read only when they are explicitly used (<Source>.ExtractMemo
This page is also available for…