AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Records read
  • Looping through a data file
  • Memos
  • Locks
  • Miscellaneous
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
Reads a record in a data file according to a given record number. This read mode is called "Direct access". The record read is loaded in memory. <Source>.State is used to find out the record status (active, crossed or deleted).
In most cases, <Source>.Read is used to position in the data file in order to perform a read loop by specifying the record number.
Several cases may occur after the call to <Source>.Read:
  • the specified record number does not exist (greater than the total number of records or negative): no reading is performed and function <Source>.Out returns True.
  • the specified record number no longer exists (record scratched, deleted, etc.): no playback is performed and function <Source>.Out returns False.
    Use <Source>.State to find out the record status.
  • the data file is empty: function <Source>.Out returns True.
  • the function attempts to block a record already blocked in play mode: function HErrorLock returns True and function <Source>.Out returns True.
    Java JDBC access: lock management is not supported for databases that are accessed through JDBC.
This function can be used with the data files (indexed or not) and with the HFSQL views.
Ejemplo
// Sequential iteration to display the name of all customers
i is int
FOR i = 1 _TO_ Customer.NbRec(hStateAll)
Customer.Read(i)
IF Customer.State() = hStateActive THEN
Info("Customer name: " + Customer.Name)
END
END
Sintaxis
<Result> = <Source>.Read([<Record number> [, <Options>]])
<Result>: Booleano
  • True if the record was read,
  • False in the event of an error (block, end of data file, etc.): the record is not read. HError is used to identify the error.
<Source>: Tipo de fuente especificada
Name of the HFSQL data file, view or query used.
<Record number>: Entero opcional
Number of the record to read.
If this parameter is not specified (or is equal to 0 or to the hCurrentRecNum constant), <Source>.Read will read the current record.
OLE DBConectores Nativos <Source>.Read reads the current record only. You cannot specify a record number other than the current one. To specify the current record number, use the hCurrentRecNum constant.
Java Access via JDBC: The <Source>.Read FUNCTION function reads only the current Record. You cannot specify a record number other than the current one. To specify the current record, use the hCurrentRecNum constant.
<Options>: Constante opcional
Configures the lock set on the record read by <Source>.Read:
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.
hLockWriteWrite lock: the record currently read can be read by another application but it cannot be modified by another application.
Hyper File 5.5 The lock options are ignored. Use locking functions (<Source>.LockRecNum) kept for backward compatibility.
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.
Java Access through JDBC: This parameter is ignored.
Observaciones
WINDEVJavaCódigo de Usuario (UMC)Lenguaje ExternoHFSQL ClassicHFSQL Client/ServerProcedimientos almacenadosHyper File 5.5

Records read

<Source>.Read is the only function that can be used to access a crossed or deleted record. If the record is deleted, the content of the record is not valid anymore.

Looping through a data file

<Source>.Read cannot be used to continue an iteration started by <Source>.ReadFirst, <Source>.ReadNext.

Memos

The memos associated with the record can be automatically read (or not) when reading the record. <Source>.SetMemo is used to customize this automatic read operation.
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).
WINDEVCódigo de Usuario (UMC)Lenguaje ExternoHFSQL ClassicHFSQL Client/ServerProcedimientos almacenadosHyper File 5.5OLE DBConectores Nativos

Locks

By default (<Options> not specified), the record is not locked.
If a lock is requested (hLockWrite or hLockReadWrite constant), the record will be read only if this record is not already locked.
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.

Miscellaneous

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