Wednesday, September 22, 2021

ODI - Define Variable and use in a package

Usecase: we will create a projet and map source employee tablw to target employee table. Where we will create a project variable and use them in target table employee name field.

Steps:

Step1: First create the topology physical and logical schema, context

Step2: Create model based on the logical schemas and create datastore for the db tables

Step3: Then create a project and go to mappings and creatw new mapping.

Step4: Drag and drop source and target tables to the map and do automap by name.

Step5: Go to the project variables node and create new variable and provide variable name and default value as "Sri" and save.

Step6: Go to the map and select target table employee name and edit expression and add projext variable from the ODI objects sections and apply and save.


Step7: Go to thr physical tab of mapping and specify the optimization context like HR etc  save.

Step8: Go to the logical section of map and select default and provide LKM: LKM SQL to SQL.

Target table IKM : IKM SQL control append

Flow control: False as dont have primary key.

Save.

Step9: Go to project packages and create new package like PKG_EMP_Variable

Drag and drop created map to the package.

Drag and drop created variable to the package.

Link variable step to map

Select variable and go to general tab and mention step name and type as declare variable.

Note: set variable is used to use fixed data.

Save. Run and ok.


Now suppose you want to use case when and use multiple variable logic in expression.

Then create the variables required and edit expression and add the logic.




Link them in package and use declare variable as type.




No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...