Table of Contents

Search

  1. Preface
  2. XML Concepts
  3. Using XML with PowerCenter
  4. Working with XML Sources
  5. Using the XML Editor
  6. Working with XML Targets
  7. XML Source Qualifier Transformation
  8. Midstream XML Transformations
  9. Appendix A: XML Datatype Reference
  10. Appendix B: XPath Query Functions Reference

XML Guide

XML Guide

Type II Entity Relationship Example

Type II Entity Relationship Example

You can create an inheritance relationship between a column and a complex type view. The column must be an element of a local complex type. The view must be rooted at a global complex type. The local complex type must be derived from the global complex type.
For example, the following schema defines a complex type called EmployeeType. EmployeeType contains EmployeeNumber and EmployeeName elements.
EmployeeStatusType includes an element called Employee that extends EmployeeType. Employee includes an EmployeeStatus element.
<xs:element name="Employee_Payroll">    <xs:complexType>    <xs:sequence>       <xs:element name="
EmployeeStatus
" type="EmpStatusType"          maxOccurs="unbounded"></xs:element>    </xs:sequence>    </xs:complexType> </xs:element> <xs:complexType name="EmpStatusType">    <xs:sequence>       <xs:element name="
Employee
" minOccurs="0" maxOccurs="1">          <xs:complexType>          <xs:complexContent>          <xs:extension base="
EmployeeType
">             xs:sequence>                <xs:element name="EmployeeStatus" type="xs:string">               </xs:element>             </xs:sequence>          </xs:extension>          </xs:complexContent>          </xs:complexType>       </xs:element>    </xs:sequence> </xs:complexType> <xs:complexType name="
EmployeeType
">    <xs:sequence>       <xs:element name="EmployeeName" type="xs:string"></xs:element>       <xs:element name="EmployeeNumber" type="xs:string"></xs:element>    </xs:sequence> </xs:complexType> </xs:schema>
When you import the schema, the Designer creates a view for Employee_Payroll, EmployeeType, and EmployeeStatus. The EmployeeStatus view contains the column called Employee. Employee derives from EmployeeType.
The following figure shows the Employee_Payroll view, the EmployeeType view, and the EmployeeStatus XML view:
The Employee_Payroll view contains the Employee_Payroll element and a primary key, PK_Employee_Payroll. The Employee_Payroll view is connected to the EmployeeStatus view by a blue line that indicates a one- to- many relationship between the views. Employee_Payroll contains multiple occurrences of EmployeeStatus.
The EmployeeStatus view contains an Employee element of type EmployeeType. The Employee element extends EmployeeType by including an EmployeeStatus element. The EmployeeStatus view also contains a foreign key to Employee_Payroll. The EmployeeStatus view is connected to an EmployeeType view with a gray arrow. The arrow indicates a type relationship between the views.
The EmployeeType view contains an EmployeeType that consists of EmployeeName and EmployeeNumber.

0 COMMENTS

We’d like to hear from you!