Declares a (1,1) (0,n) link between two tables. Only the records found in the target table with a corresponding record in the source table (while respecting the filter of this one) will be replicated during a universal replication.
Remark: This function can be used during the universal replication only.
Remark: The replication is not available when accessing a database via
Remote access.
Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 19 and later
New in version 19
Versions 21 and later
New in version 21
// Retrieve a subscriber as well as his messages
HCreateSubscriberReplica("", "", "Mr X", 0, "Messages" + CR + "Recipients")
// Filter the messages
HFilter(Recipients, Name, "X")
// Declare the link
HRplDeclareLink(Recipients, Messages, MessagesID, MessagesID)
HCreateMoveableReplica("", "", rplToSubscriber)
Syntax
<Result> = HRplDeclareLink(<Name of source file> , <Name of source item> , <Name of target file> , <Name of target item>)
<Result>: Boolean
- True if the operation was performed,
- False if a problem occurred (the specified tables and items do not exist for example). HError is used to identify the error. Caution: <Result> is set to True even if the specified files/tables are not replicated.
<Name of source file>: Character string (with or without quotes)
Name of the file or table whose multiplicity is set to (1, 1).
<Name of source item>: Character string (with or without quotes)
Name of the item affected by the link in the source file.
<Name of target file>: Character string (with or without quotes)
Name of the file or table whose multiplicity is set to (0, n).
<Name of target item>: Character string (with or without quotes)
Name of the item affected by the link in the target file.
Remarks
- The operation is taken into account only if the source table/file is specified AFTER the target table/file in the list of tables passed to HCreateSubscriberReplica.
- The filtering performed on the second file/table is not respected.
- As soon as a file is target of a declared link, this file is replicated via this link only.
- If a file is the source of two links, a record will be replicated if it belongs to one of the links.