Example: Grandchild Data Synchronization

Previous Next

See Also

Suppose you want to display a list of Participants for each Scheduled Tour, without displaying Reservations. You need to turn parent-child synchronization into grandparent-grandchild synchronization.

The default related query statement of the "Participants taking part in this Reservation" related info box is:

SELECT *

FROM   PARTICIPANT p

WHERE  (:"Parent*RES_ID" = p.RES_ID

OR     (:"Parent*RES_ID" IS NULL

      AND p.RES_ID IS NULL))

To get grandchild synchronization between Participants and Scheduled Tours, make a subclass of this related info box, rename it to "Participants taking part in this Scheduled Tour", and change the main query to:

SELECT p.*

 FROM PARTICIPANT p, RESERVATION r

WHERE (:"Parent*SCHEDTOUR_ID" = r.SCHEDTOUR_ID

      AND r.RES_ID = p.RES_ID)

      OR (:"Parent*SCHEDTOUR_ID" IS NULL

      AND p.RES_ID IS NULL))