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
  • Función de replicación y WithSpace
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
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: A movable replica can be created from the master database or from the 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.
Universal Windows 10 AppAndroidWidget Android iPhone/iPad Only the universal replication is available.
Ejemplo
WINDEVWEBDEV - Código ServidorReportes y ConsultasCódigo de Usuario (UMC)AjaxHFSQL ClassicHFSQL Client/ServerHyper File 5.5
// REPLICATION JOURNALEE
// A Montpellier: Préparation de l'envoi des messages à Paris
HCreateMovableReplica("P:\MSG\MSG.rpm", "Paris", "c:\temp\MsgMPL.WDZ")
// Envoie du fichier (par FTP par exemple)
FTPSend("c:\temp\MsgMPL.WDZ", "FTP.PCSOFT_PARIS.FR\MSG\MsgMPL.WDZ") 
----------------
// A Paris: Récupération des messages de Montpellier
HSynchronizeReplica("Z:\MSG", "\\FTPSERVEUR\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 if it corresponds to an empty string (""), the description file will be sought in the current directory.
Caution: this directory must be accessible when HCreateMovableReplica is executed.
<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 that you use an empty string (""): the name of the file will be automatically calculated by the function.
After the call to HCreateMovableReplica, the RPL.File variable contains the name of the movable replication file that was created. Caution: The value of this variable is available 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__.rpa
  • Replica created from the subscriber database to update the master database: From__.rpa
    where:
    • <SubscriberName>: Name of the subscriber in readable format (identifier specified in HCreateSubscriberReplica).
    • <XXX>: Number of the replica (incremented per subscriber and per replication direction).
After the call to HCreateMovableReplica, the RPL.File variable contains the name of the movable replication file that was created. Caution: The value of this variable is available 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:
  • rplHAdd: replicate an addition.
  • rplHModify: replicate a modification.
  • rplHDelete: replicate a deletion.
RPL.ConflictInteger constantIndicates whether a conflict was detected during the replication. The possible values are as follows:
  • rplNoConflict: no conflict was detected.
  • rplModifyConflict: The record was modified both in the source replica and in the destination replica.
  • rplDeleteConflict: The record was deleted from the destination replica and it was modified or deleted in the 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):
  • rplToSubscriber: replication from master to subscriber.
  • rplToMaster: 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.

Función de replicación y WithSpace

La replicación no es compatible con WithSpace en el código de la aplicación cliente. Esta función cambia el comportamiento de HFSQL. El uso de esta función en la aplicación cliente puede afectar a la eficiencia de la replicación.
A partir de la versión 21 actualización 3 (versión 210065), las funciones de sincronización (replicación universal programada o asistida) devuelven un error a la aplicación cliente si se ha aplicado WithSpace a al menos uno de los archivos replicados.
Componente: wd290rpl.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: 21/03/2024

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