AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Handling a crossed record
  • Number of crossed records
  • Version of data file
  • Crossing a record from a query
  • Special cases
  • xBase data files
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
Crosses a record in a data file. The record is deleted logically and it can be retrieved if necessary.
The following operations are performed:
  • the record becomes inactive. The data is stored (which is not the case when a record is deleted by <Source>.Delete).
  • the indexes (corresponding to the record keys) are deleted from the index file.
  • the memos associated with the record are stored.
This function can be used on the data files, the HFSQL Mobile views or the queries.
Ejemplo
// Crosses the record #123
Customer.Cross(123)
// Cross the customer orders
Order.ReadSeekFirst(CUSTNUM, ValCustNum)
WHILE Order.Found() = True
Order.Cross()
Order.ReadNext()
END
Sintaxis
<Result> = <Source>.Crossed([<Record number> [, <Options>]])
<Result>: Boolean
  • True if the record was crossed,
  • False in case of error (blocked record, integrity problem, etc.). HErrorInfo returns more details.
<Source>: Tipo de fuente especificada
Name of HFSQL data file, query or view used.
<Record number>: Entero opcional
Number of the record to cross.
If this parameter is not specified (equal to 0 or the constant hNumEnrEnCours), the current Record will be scratched.
<Options>: Constante opcional
Configures:
  • the lock mode applied to the crossed record. If no lock constant is specified, the crossed record is not locked.
    hLockNo
    (default value)
    No blocking: scratched recordings will not be blocked.
    hLockReadWriteLock in read/write mode: the currently scratched record cannot be viewed or reactivated by another application.
    hLockWriteLock in write mode: the currently scratched record can be read and consulted (function <Source>.Read) by another application, but cannot be reactivated by another application. Only the current application can re-enable it.
  • the integrity management applied to the crossed record.
    hCheckIntegrityChecks the integrity for the operation, even if the automatic integrity check is disabled (<Connection variable>.SetIntegrity).
    hIgnoreIntegrityIgnores the integrity check for this operation, even if the automatic integrity check is enabled (<Connection variable>.SetIntegrity).

    A WLanguage error occurs if the two constants are used at the same time. These constants have no effect on the cascading deletion.
Observaciones

Handling a crossed record

Number of crossed records

<Fuente>.NbRec is used to find out the number of crossed records in the data file.
Note: For compatibility with WEBDEV 1.5/WINDEV 5.5, it is also possible to find out the number of scratched records using the variable h.NbSup.

Version of data file

If <Source>.Cross is successful, the data file version number is modified. This version number is returned by <Source>.Version.

Crossing a record from a query

A record can be crossed:
  • in the query result.
  • or directly in the data files manipulated by the query (constant HModifiesFile used in functions <Source>.ExecuteQuery or <Source>.ExecuteSQLQuery). In this case, the hWithFilter constant is automatically selected.
Regardless of how the query is executed (with or without the constant hWithFilterconstant), the <Source>.Cross function can only be used on single-file requests.
Caution:
  • Records cannot be crossed in a query that uses groups or aggregates.
  • Integrity and duplicates are not managed by operations on multi-file queries: it is advisable to use transactions to avoid any problems.

Special cases

  • Blocking management:
    If a lock problem occurs when "crossing" a record (attempt to cross a record locked in write mode for example), the record is not modified and HErrorLock returns True.
  • Managing the referential integrity
    If the management of the referential integrity is enabled (<Connection variable>.SetIntegrity) and if the integrity is not checked during the deletion, <Source>.Cross is not run. HErrorIntegrity must be checked after <Source>.Cross.
  • Deleted records
    <Source>.Cross must not be called on a record that was deleted beforehand.
WEBDEV - Código ServidorConectores Nativos

xBase data files

The <Source>.Delete function has the same effect as the <Source>.Cross FUNCTION The Record is scratched, not deleted. Therefore, the record can be re-enabled using <Source>.Modify. In this case, <Source>.State returns the hStateCrossed constant for a deleted record (instead of hStateDel).
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