Specifying Target Order

  1. Understand Default Behavior
    • Mappings with multiple targets do not follow a defined order of loading data by default. The targets will be loaded in an arbitrary order unless explicitly defined.
  2. Access the Property Inspector
    • Click the background in the logical diagram to deselect objects in the mapping. This will bring up the Property Inspector for the mapping.
  3. Set Target Load Order
    • In the Property Inspector, you can:
      • Accept the default target load order.
      • Enter a new target load order in the Target Load Order field.
  4. Default Load Order
    • The default load order is automatically computed based on primary key/foreign key relationships between the target datastores in the mapping.
    • If you want to change the order, you can modify it, but if the modification conflicts with the primary key/foreign key relationship, a warning will appear when you validate the mapping.
  5. Adjust Target Load Order Using the Gear Icon
    • Hover over or select the Target Load Order field and click the gear icon to open the Target Load Order Dialog.
    • The dialog will display all available datastores (and reusable mappings with datastores) that can be targets.
  6. Rearrange the Order of Processing
    • In the Ordered Targets field of the dialog, you can move targets to define the processing order.
    • Use the icons on the right to rearrange the order as needed.
  7. Tip for Foreign Key Relationships
    • The target load order is especially useful when there are foreign key (FK) relationships between targets.
    • For example, if there are two targets, EMP and DEPT, and EMP.DEPTNO is a foreign key to DEPT.DEPTNO, you must ensure DEPT is loaded first, followed by EMP. Set the target load order to DEPT, EMP to guarantee this.
  8. Reusable Mappings
    • The Target Load Order property also applies to reusable mappings. If a reusable mapping contains a source or target datastore, it can be included in the Target Load Order property of the parent mapping.

No comments:

Post a Comment