You are on page 1of 4

Exercises for Lesson 4 Designer Transformations

1. Introduction
Now that we have successfully created a first basic interface, build a more complex one, by introducing heterogeneous components.

2. Open the Interface


The project Lesson 04 Heterogeneous contains a basic interface (the same as the one we built in the previous lesson).

To open this interface, you can: - Either double-click on the interface name in the tree - Or right-click and select Edit. In the definition tab, rename the interface to: Customer Lesson 4-1

Rev 2.2

03/03/2008

3. Modify the Interface


Modify the interface as follows: Source tables: - Add the SRC_CITY table from HSQL Sales Join the two source tables on CITY_ID: - Drag and drop the CITY_ID column from SRC_CUSTOMER table on the column CITY_ID from SRC_CITY. This will automatically create the join expression.

3.1 Mappings
Change the mapping for CITY_ID. Replace the mapping so that we now retrieve the CITY_ID from the CITY table HSQL column City_id from SRC_CITY Oracle Column City_id Transformation None

3.3 Data Flow


Click on the Flow tab of the interface. Notice that there is very little change here. Both source tables are on the same server, as such they will be joined before any extraction can be done. There is no need for any additional KM. Change options as follows for the IKM (click on the caption of the box that represents the target system): Insert Commit Flow Control Recycle Errors Static Control Truncate Delete All Create Target Table Delete Temporary Objects <Default>:Yes <Default>:Yes No <Default>:No <Default>:No <Default>:No Yes <Default>:No <Default>:Yes

Rev 2.2

4-2

03/03/2008

4. Run
Click the Execute button. Then go in the operator interface, and expand All Executions to see the outcome of your job. If you have an error (red stop sign) go back to your interface and fix the problem. A successful run should have inserted 4 records.

5. Heterogeneous sources
We will now modify this same interface further and add two additional sources. First close the interface, then right-click on the interface name and select duplicate. This will create a copy of your interface. Open this new interface and rename it Customer Lesson 4-2

5.1 Sources
Modify the interface as follows: Source tables: - Add SRC_AGE_GROUP.TXT and SRC_SALES_PERSON.TXT, from the Flat Files Sources model.

5.2 Joins
Join SRC_CUSTOMER with SRC_SALES_PERSON.txt on SALES_PERS_ID and SALES_ID Join SRC_CUSTOMER with SRC_AGE_GROUP.txt with the AGE between the AGE_MIN and the AGE_MAX

5.3 Mappings
Auto-mapping should have filled in the columns that were not mapped so far. The mappings should now be: HSQL column Dear Oracle Column Dear Transformation Change 0 into Mr Change 1 into Mrs Change 2 into Ms Concatenate the first name and the last name. Capitalize the first letter for both. Put a space between first and last

First_Name, Last_Name

CUST_NAME

Rev 2.2

4-3

03/03/2008

Address Phone Age

Address Phone Age Age_Range Sales_Pers

Cre-Date

Upd_Date Custid City_id Cust_id City_id

name None None None Age_Range from File Concatenate Sales reps first name and last name. Do an RTRIM on both the First name and the last name System date on the target machine. Do not modify this value if there is an update System date on the target machine None None

5.4 Data Flow


We now have more source systems, and these different source systems are visible in the Flow tab. Notice that for the new systems (our two flat files), we now have a choice of LKMs. Make sure that both files use LKM File to SQL to load data into Oracle.

5.5 Run
Click the Execute button. Then go in the operator interface, and expand All Executions to see the outcome of your job. If you have an error (red stop sign) go back to your interface and fix the problem. A successful interface should insert 4 records.

Rev 2.2

4-4

03/03/2008

You might also like