PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Name of movable replica (universal replication)
  • Variables automatically initialized in the WLanguage procedure for filtering records
  • Replication and WithSpace function
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
HCreateMoveableReplica (Function)
In French: HCréeRéplicaTransportable
ODBCOLE DBNot available with these kinds of connection
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 is available for a logged replication or for a universal replication.
Note: 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.
AndroidAndroid Widget iPhone/iPadWindows MobileUniversal Windows 10 App Only the universal replication is available.
Note: The replication is not available when accessing a database via Remote access.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 19 and later
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 19
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 22 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
New in version 22
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
Example
WINDEVWEBDEV - Server codeReports and QueriesWindows MobileAjaxUser code (UMC)HFSQLHFSQL Client/ServerHyper File 5.5
// LOGGED REPLICATION
// In Montpellier: Prepare to send messages to Paris
HCreateMoveableReplica("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: Retrieve the messages from Montpellier
HSynchronizeReplica("Z:\MSG", "\\FTPSERVER\MSG\MsgMPL.WDZ", rplToMaster)
Syntax
<Result> = HCreateMoveableReplica(<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 (with quotes)
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 running HCreateMoveableReplica.
<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 (with quotes)
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 HCreateMoveableReplica, the RPL.File variable contains the name of the movable 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).
Remarks

Name of movable replica (universal replication)

This name is automatically built by HCreateMoveableReplica.
This name has the following format:
  • Replica created from the master database to update the subscriber: To_<SubscriberName>_<XXX>.RPA
  • Replica created from the subscriber database to update the master database: From_<SubscriberName>_<XXX>.RPA
    where:
    • <SubscriberName>: Name of the subscriber in clear (identifier specified in HCreateSubscriberReplica).
    • <XXX>: Number of the replica (incremented per subscriber and per replication direction).
After the call to HCreateMoveableReplica, the RPL.File variable contains the name of the movable 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.

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.
Versions 21 and later
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.
New in version 21
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.
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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230rpl.dll
Windows Mobile wp230rpl.dll
Linux wd230rpl.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment