Thursday, January 26, 2017

REUSABLE mappings - ODI 12c

REUSABLE mappings are also part of mappings where you can build them like regular mappings with INPUT and OUTPUT signatures along with all regular mapping components.These mappings will have only Logical layer ,no Physical layer.
Those will avoid the labor of doing same work again and again in your mapping. If you need a same code used to be many places then just create a re usable mapping and use it wherever required.

In this blog we will see how to find the employee salary grade based on his salary value.
Note: There is table SALGRADE which will give the grade based on salary number.

We will create a Reusable mapping to find employee salary grade.This reusable mapping can be used as many as times by passing empno and his salary as inputs to this mapping.

Creating a Reusable mapping.


1.Right click on Reusable Mappings, and select New Reusable Mapping.
Select Create Default INPUT and OUTPUT Signature check boxes.
























2. Create two attributes in INPUT SIGNATURE as shown below to find Grade of employee salary.






















3.Now add the remaining regular mapping components to build the logic.
Here I have added a SALGRADE datastore and LOOKUP component and provided lookup condition .

































4.Map the required columns to OUTPUT signature






















5.Save and Close .

Creating a Mapping


1.Right click on Mappings and select New Mapping .
2.Add the required components into it.
Added EMP table and above created Reusable mapping 
and mapped EMPNO to IN_EMPNO
and SAL to IN_SAL




















3.Add remaining components.
I have added EMP and DEPT and Joined them using JOIN component.





















4.Now join both Reusable mapping and remaining datastores using JOIN. 























5.Finally map them to Target datastore and provide proper KMs in physical layer.



























No comments:

Post a Comment