Multiple-Occurring Output Configuration
When an Input transformation or Web Service Consumer transformation returns multiple-occurring data, you can configure the output ports in different configurations.
You can configure normalized output data, pivoted output data, or denormalized output data.
For example, a SOAP message contains Departments and Employees complex elements. Each department contains multiple employees. Departments is the parent of Employees.
The SOAP message contains the following element hierarchy:
Departments
Department_ID
Department_Name
Employees
Employee_ID
Employee_Name
Normalized Relational Output
When you create normalized output data, the data values do not repeat in an output group. You create a one-to-one relationship between the hierarchy levels in the SOAP message and the output groups of ports.
When the SOAP message contains a Departments parent hierarchy level and an Employees child hierarchy level, you might create the following groups of ports:
Departments
Department_Key
Department_ID
Department_Name
Employees
Department_Key
Employee_ID
Employee_Name
The Department_Key is a generated key that relates the Employees output group to a Department group.
Generated Keys
When you add an output group, the Developer tool relates the output group to another output group with a generated key. The Developer tool adds a bigint key to the parent group and to the child group. At run time, the Data Integration Service creates the key values for the generated keys.
Example
The SOAP hierarchy has the following nodes:
Departments
Dept_Key
Dept_Num
Dept_Name
Employees
Dept_FK
Employee_Num
Employee_Name
When you create an output group of ports for Departments, you map the Departments node to an empty field in the Ports area. The Developer tool creates the following output group:
Departments
Dept_Num
Dept_Name
When you map the Employees node to an empty field in the Ports area, the Developer tool prompts you to relate the Employees group to the Departments group. You can relate the Employees group to more than one group. The Developer tool adds a key to the each group.
The Developer tool creates the following groups and generated keys:
Departments
Key_Departments
Dept_Num
Dept_Name
Employees
Key_Departments
Employee_Num
Employee_Name
Note: You do not have to map nodes to the generated keys. The Data Integration Service creates the key values at run time.
The Developer tool can create generated keys to multiple levels in one output group. The Employees group might contain the following ports:
Employees
Key_Employees
Key_Departments
Key_Managers
Employee_Num
Employee_Name
Key_Departments and Key_Managers are the generated keys that point to parent groups. Key_ Employees is a generated key for the Employees group. Key_Employees appears when you relate a child group to the Employees group.
Denormalized Relational Output
You can denormalize relational output. When you denormalize the output data, the element values from the parent group repeat for each child element.
To denormalize output data, map nodes from the parent hierarchy level to the child group of output ports.
The following example shows the Department_ID and the Department_Name in the Employees output group:
Employees
Department_ID
Department_Name
Employee_ID
Employee_Name
Department_ID and Department_Name repeat for each employee in the department:
Department_ID | Department_Name | Employee_ID | Employee_Name |
---|
100 | Accounting | 56500 | Kathy Jones |
100 | Accounting | 56501 | Tom Lyons |
100 | Accounting | 56509 | Bob Smith |
Pivoted Relational Output
You can include a specific number of multiple-occurring elements in an output group.
To pivot multiple-occurring elements, map the multiple-occurring child element to the parent group of output ports. The Developer tool prompts you to define the number of child elements to include in the parent.
The following example shows two instances of Employee_ID in the Departments parent group:
Departments
Department_ID
Department_Name
Employee_ID1
Employee_ID2