AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • Name of movable replica (universal replication)
  • Variables automatically initialized in the WLanguage procedure for filtering records
  • Replication and WithSpace function
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
Advertencia
A partir de la versión 27 (87), HCreateMoveableReplica se conserva por motivos de compatibilidad. Esta función ha sido reemplazada por HCreateMovableReplica.
Creates a movable replication. This file can be used to replicate the data found in the current database toward a remote database (for sending by email or FTP for example).
This function can be used with log-based or universal replications.
Remark: It is possible to create a transportable replica of the master or subscriber database.. To create a portable replica intended for a subscriber (replication from master to subscriber), the data files of the master must be opened beforehand.
AndroidWidget Android iPhone/iPad Only universal replication is available.
Ejemplo
HFSQL ClassicHFSQL Client/Server
// LOG-BASED REPLICATION
// In Montpellier: Preparing to send messages to Paris
HCreateMovableReplica("P:\MSG\MSG.rpm", "Paris", "C:\Temp\MsgMPL.WDZ")
// Send the file (by FTP for example)
FTPSend("C:\Temp\MsgMPL.WDZ", "FTP.PCSOFT_PARIS.FR\MSG\MsgMPL.WDZ") 
----------------
// In Paris: Message recovery from Montpellier
HSynchronizeReplica("Z:\MSG", "\\FTPSERVER\MSG\MsgMPL.WDZ", rplToMaster)
Sintaxis
<Result> = HCreateMovableReplica(<Master replica or subscriber replica> , <Identifier of subscriber replica> , <Name of replication file to create> [, <Filter of records to replicate>])
<Result>: Boolean
  • True if the file corresponding to the movable replica was created,
  • False otherwise.
<Master replica or subscriber replica>: Character string
Name and full (or relative) path of Master replica (".rpm" file) or Subscriber replica (".rpl" file). A UNC path is allowed.
If this parameter is not specified or is an empty string (""), the description file will be searched for in the current directory.
Warning this directory must be accessible when executing the function HCreateMovableReplica.
<Identifier of subscriber replica>: Integer or character string
Identifier of the subscriber replica to use. This identifier was returned by HCreateSubscriberReplica. This identifier is required only when the replication is performed from the master database to the subscriber database ; otherwise, it is ignored.
In universal replication, this parameter is required in any case.
<Name of replication file to create>: Character string
Full name corresponding to the physical replication file to create. This file contains the data required by the remote replication toward the replica (master or subscriber) identified by its identifier. This file contains the data modified since the last successful replication.
The created file is an archive file (".WDZ" extension by default) containing the description of the master replica or subscriber replica as well as sections of the data files required by the replication. This extension can be modified.
For the universal replication, the content of this parameter is ignored. We recommend using an empty string (""): the file name will be automatically calculated by the.
After the call to HCreateMovableReplica, the RPL.File variable contains the name of the movable replication file that was created. Warning The value of this variable is available only until the next call to a replication function.
<Filter of records to replicate>: Optional character string
Name of the WLanguage filter procedure called for each record taken into account by the replication.
This procedure is used to filter the records to replicate. If this procedure returns False, the record is ignored:
  • it will not be copied into the subscriber database during a first synchronization,
  • it will be removed from the subscriber database if it was taken into account during a former synchronization.
If this procedure returns True, the record is taken into account by the replication.
Several variables can be used in this procedure (see Remarks).
Observaciones

Name of movable replica (universal replication)

This name is automatically built by HCreateMovableReplica.
This name has the following format:
  • Replica created from the master database to update the subscriber: To_.<NomAbonne>_<XXX>.rpa
  • Replica created from the subscriber database to update the master database: From_.<NomAbonne>_<XXX>.rpa
    where:
    • <NomAbonne>: Subscriber's plain name (identifier given in function HCreateSubscriberReplica).
    • <XXX> Replica number (incremented by subscriber and replication direction).
After the call to HCreateMovableReplica, the RPL.File variable contains the name of the movable replication file that was created. Warning The value of this variable is available only until the next call to a replication function.

Variables automatically initialized in the WLanguage procedure for filtering records

The following variables are automatically initialized in the WLanguage procedure for filtering records (the name of the procedure corresponds to the <Filter of records to replicate> parameter).
VariableTypeDescription and values
RPL.FileCharacter stringName of the file whose data will be replicated.
RPL.OperationInteger constantHFSQL operation that will be replicated:
  • rplHAjoute: replication of an addition.
  • rplHModifies replication of a modification.
  • rplHSupprime replication of a deletion.
RPL.ConflictInteger constantIndicates whether a conflict was detected during the replication. The possible values are as follows:
  • rplNoConflict: no conflict detected.
  • rplConflitModification Record has been modified on both source and destination replicas.
  • rplConflitDeletion Record deleted on destination replica and modified or deleted on source replica.
To force the replication if a conflict occurred, RPL.Conflict must be initialized with the rplNoConflict variable.
Otherwise, the replication will be performed only if the conflict is a modification conflict and if the data to replicate comes from the master database.
RPL.DirectionInteger constantIndicates the direction of replication (useful for a bidirectional replication):
  • rplVersAbonné: replication from master to subscriber.
  • rplVersMaître: replication from subscriber to master.
RPL.OperationNumIntegerNumber of the current operation. This value is included between 1 and RPL.OperationMax. This variable allows you to easily manage a progress bar.
RPL.OperationMaxIntegerTotal number of operations to replicate. This variable allows you to easily manage a progress bar.
RPL.SourceAliasCharacter stringName of the source alias for the replicated file (RPL.File). This file contains the values of the items that will be copied (HModify) or added (HAdd) into the data file currently replicated.
RPL.TargetAliasCharacter stringName of target alias of replicated file (RPL.File). This file contains the values of the items before the copy or the deletion in the data file currently replicated.

Replication and WithSpace function

The replication is not compatible with WithSpace in the code of the client application. This function changes the nehavior of HFSQL. Using this function in the client application can affect the efficiency of replication. From version 21 update 3 (version 210065), the synchronization functions (programmed or assisted universal replication) return an error to the client application if WithSpace was applied to at least one of the replicated files.
Componente: wd300rpl.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

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