Table of Contents

Search

  1. Preface
  2. Product Overview
  3. Before You Begin
  4. Tutorial Lesson 1
  5. Tutorial Lesson 2
  6. Tutorial Lesson 3
  7. Tutorial Lesson 4
  8. Tutorial Lesson 5
  9. Tutorial Lesson 6
  10. Naming Conventions
  11. Glossary

Getting Started

Getting Started

Creating the Target Definition

Creating the Target Definition

In this lesson, you import an XML schema and create a custom view based on the schema. The custom XML target definition you create meets the following criteria:
  • Each department has a separate target and the structure for each target is the same.
  • Each target contains salary and department information for employees in the Sales or Engineering department.
Because the structure for the target data is the same for the Engineering and Sales groups, use two instances of the target definition in the mapping. In the following steps, you import the Sales_Salary schema file and create a custom view based on the schema.
  1. In the Designer, switch to the Target Designer.
    If the workspace contains targets from other lessons, right-click the workspace and choose
    Clear All
    .
  2. Click
    Targets
    Import XML Definition
    .
  3. Navigate to the Tutorial directory in the PowerCenter installation directory, and select the Sales_Salary.xsd file. Click
    Open
    .
    The
    XML Wizard
    appears.
  4. Name the XML definition SALES_SALARY and click
    Next
    .
  5. Select
    Do not generate XML views
    and click
    Finish
    .
    The
    XML Wizard
    creates the SALES_SALARY target with no columns or groups.
  6. Double-click the XML definition to open the
    XML Editor
    .
  7. Click
    XMLViews
    Create XML View
    .
    The
    XML Editor
    creates an empty view.
    The following image shows an empty XML view:
    ""
    1. Empty XML View
  8. Right-click DEPARTMENT group in the
    Schema Navigator
    and select
    Show XPath Navigator
    .
  9. From the
    XPath Navigator
    , drag DEPTNAME and DEPTID into the empty XML view.
    The
    XML Editor
    names the view X_DEPARTMENT.
    The
    XML Editor
    may transpose the order of the attributes DEPTNAME and DEPTID. If this occurs, add the columns in the order they appear in the Schema Navigator. Transposing the order of attributes does not affect data consistency.
  10. In the X_DEPARTMENT view, right-click the DEPTID column, and choose
    Set as Primary Key
    .
  11. Click
    XMLViews
    Create XML View
    .
    The
    XML Editor
    creates an empty view.
  12. From the EMPLOYEE group in the
    Schema Navigator
    , Navigate to the
    XPath Navigator
    .
  13. From the
    XPath Navigator
    , drag EMPID, FIRSTNAME, LASTNAME, and TOTALSALARY into the empty XML view.
    The
    XML Editor
    names the view X_EMPLOYEE.
  14. Right-click the X_EMPLOYEE view and choose
    Create Relationship
    .
    Drag the pointer from the X_EMPLOYEE view to the X_DEPARTMENT view to create a link.
  15. The
    XML Editor
    creates a DEPARTMENT foreign key in the X_EMPLOYEE view that corresponds to the DEPTID primary key.
  16. Click
    File
    Apply Changes
    .
    The XML definition now contains the groups DEPARTMENT and EMPLOYEE.
    The following image shows an XML definition that contains the groups DEPARTMENT and EMPLOYEE:
    ""
  17. Click
    Repository
    Save
    to save the XML target definition.

0 COMMENTS

We’d like to hear from you!