|
|
|
|
|
- Name of movable replica (universal replication)
- Variables automatically initialized in the WLanguage procedure for filtering records
- Replication and WithSpace function
HCreateMovableReplica (Function) In french: HCréeRéplicaTransportable
![ODBC ODBC](https://doc.windev.com/ext/images/us/ODBC.png?-43363683) Not available with these kinds of connection
Warning
From version 27 (87), HCreateMoveableReplica is kept for backward compatibility. This function has been replaced with 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: 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. Syntax
<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). Remarks 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_<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 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). | | | Variable | Type | Description and values |
---|
RPL.File | Character string | Name of the file whose data will be replicated. | RPL.Operation | Integer constant | HFSQL operation that will be replicated:- rplHAdd: replicate an addition.
- rplHModify: replicate a modification.
- rplHDelete: replicate a deletion.
| RPL.Conflict | Integer constant | Indicates 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.Direction | Integer constant | Indicates the direction of replication (useful for a bidirectional replication):- rplToSubscriber: replication from master to subscriber.
- rplToMaster: replication from subscriber to master.
| RPL.OperationNum | Integer | Number of the current operation. This value is included between 1 and RPL.OperationMax. This variable allows you to easily manage a progress bar. | RPL.OperationMax | Integer | Total number of operations to replicate. This variable allows you to easily manage a progress bar. | RPL.SourceAlias | Character string | Name 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.TargetAlias | Character string | Name 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.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|