Working with Parent-Child Table Relationships
Data models typically contain tables that share column data through a relationship. You can configure a publishing table to include related data from another table for publication. Data from the related table is not copied to the publishing table, but is fetched by reference.
Adding child tables for Publication Service and Subscription Service requires separate procedures. In Publication Service, you can add child tables to the source table; in Subscription Service, you can add child tables to the destination table.
Restrictions
The database schema must be the same for all tables, but the table names can be different. If the child table associated with the publishing table and the child table associated with the destination table have different names, you must set a mapping between the child tables.
The following restrictions apply to parent and child tables:
- The child table in the source database and child table in the destination database must have the same columns.
- When parent-child relationships are defined, a subscriber adapter must use the same repository as the publisher adapter.
- When working with parent-child table relationships, it is good practice to set the ADB_OPCODE values in the parent table and child table to the same value. Or only set the value of the ADB_OPCODE column in the parent table and leave the child table empty.
- Adding Child Tables in Publication Service
To work with parent-child relationships, you have to first add child tables in Publication Service. - Adding Child Tables in Subscription Service
After you add child tables in Publication Service, you can use the same way to add tables in Subscription Service. After that, you can map the tables in Subscription Service with the tables in Publication Service. - Mapping Child Tables in Publication Service and Subscription Service
Child tables in Publication Service and Subscription Service must be mapped unless the child tables have the same names. After mapping, data can be transferred between Publication Service and Subscription Service.