AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Read operation according to a key item or not
  • Memos
  • Lock
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
Moves several records forward from the current position in the data file, according to a specified item.
The destination record is read and loaded in memory: HFSQL variables are updated (e.g. Customer.Name, i.e. item Name of data file Customer).
Several cases may occur after the call to <Fuente>.Forward:
  • no other record exists in the data file: <Fuente>.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 <Fuente>.Out returns True.
    PHP Management of locks not available in PHP.
    Java Access by JDBC: Locks cannot be managed in databases accessed by JDBC.
    Android Management of locks not available in SQLite databases.
This function can be used with the HFSQL files, views or queries.
Ejemplo
// Avance jusqu'au 2000ième enregistrement
// du fichier Client selon la clé NomClient
Client.LitPremier(NomClient)
Client.Avance(NomClient, 1999)
WINDEVWEBDEV - Código ServidorReportes y ConsultasJavaCódigo de Usuario (UMC)HFSQL ClassicHFSQL Client/ServerHyper File 5.5OLE DBConectores Nativos
// Test du compte-rendu de la fonction <Source>.Avance
// Avance jusqu'au 2000ième enregistrement
// du fichier Client selon la clé NomClient
Client.LitPremier(NomClient)
IF Client.Avance(NomClient, 1999, hLockWrite) = False THEN 
	IF HErrorLock() = True THEN
		Info("Cet enregistrement est en cours d'utilisation")
	ELSE
		Error(HErrorInfo())
	END
END
Sintaxis
<Result> = <Source>.Forward([<Item> [, <Step> [, <Options>]]])
<Result>: Booleano
  • True if the move was performed in the file,
  • False if an error occurred (lock, end of file, etc.): the record is not read. HError is used to identify the error.
<Source>: Tipo de fuente especificada
Name of data file, view or query used.
PHP This parameter corresponds to a file name.
<Item>: Cadena de caracteres opcional
Name of item according to which the browse is performed.
If this name is not specified, <Fuente>.Forward handles the last item in the data file used by the last HFSQL function (function starting with "H").
<Step>: Entero opcional
Number of steps forward (which means number of records to browse). By default, <Step> = 1.
PHP <Step> is mandatory if <Item> was specified.
<Options>: Constante o combinación de constantes de tipo Integer (opcional)
Configures:
  • the lock mode applied to the record read. By default, the lock performed corresponds to the current lock.
    hLockNoNo lock: the record can be read or modified by another application during the reading.
    hLockReadWriteLock in read/write mode: the record currently read cannot be read or modified by another application.
    hLockWriteLock in write mode: the record currently read can be read by another application but it cannot be modified by another application.

    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 by JDBC: Locks cannot be managed in databases accessed by JDBC.
    AndroidWidget Android Management of locks not available in SQLite databases.
  • the management of duplicates during the browse. By default, all duplicates are iterated over.
    hDistinctWhen a browse is performed on a key item, a single record is browsed if duplicates are found.
Hyper File 5.5 <Options> is ignored.
PHP <Options> is ignored.
Observaciones

Read operation according to a key item or not

In all cases, the browse operation must have been initialized by one of the following functions: <Fuente>.ReadFirst, <Fuente>.First, <Fuente>.ReadSeekFirst, <Fuente>.SeekFirst, <Fuente>.ChangeKey, <Source>.RestorePosition.
If the item used is a key item:
  • if the hDistinct constant is not specified, <Fuente>.Forward moves forward <Step> key values from the current position.
  • if the hDistinct constant is specified, <Fuente>.Forward moves forward <Step> 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.
  • <Fuente>.Forward moves foward from <Step> active records from the current position.

Memos

The memos associated with the record can be automatically read (or not) when reading the record. <Fuente>.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 (<Fuente>.ExtractMemo).

Lock

By default (no lock variable specified), the lock performed corresponds to the current lock mode.
If a lock is specified (hLockWrite or hLockReadWrite constant), the record will be read and locked only if it is not already locked by another application.
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.
PHP Locks are not supported.

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: 17/06/2024

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