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.

When rows are inserted into the publishing table, a message that includes the data from the source table and related (child) table is published. Accordingly, a table with the same columns as the child table associated with the publishing table must be specified for Subscription Service.

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.