Friday, September 11, 2015

How to create and use a Parameter file in Informatica

              I know how tedious and painful it is to change and migrate the code every time you have to do a little change. On the other hand it is not a best practice to use hard coded values in the mappings. It is always useful to create a generic code, so that it can be used as per requirements with a little change. So, today I will be talking about parameterization in Informatica. There are actually two types of parameters in Informatica based on the scope.

Workflow parameters-defined on the workflow level
Mapping parameters-defined on the mapping level

I am going to take an example here to describe both of these types of parameters. Let's say we have a requirement to use a filter on some port (field/column). It should be a mapping level parameter if the filter is only going to be used in this mapping and not in the other mappings(with same value) under the same workflow. So we will define the parameter by following the steps shown in pictures here. Say we have the filter like Dept='SALES'. This tells me that it is a string data type and length can be 10.
$$MP_DEPT

     
                                  


                         
Once you have defined the parameter, lets use it in the transformation, say SQL qualifier, we can use it as

Dept=$$MP_DEPT

Now the next step is to create a parameter file. write similar text in a text file, save it as test.prm or the name you wish.

[GLOBAL]

$DBConnection=ORA1
$$MP_DEPT='SALES'

$DB_Connection here is a workflow parameter and used for providing connection for in workflow.
Next is to give the path of parameter file in the your workflow. Right click on your workflow. Click on edit workflow and select Properties tab.




Now edit the Parameter Filename attribute. Remember to provide the full path of your parameter file along with the name.


Good to go. Have fun with your creativity and parameterization.

For steps creating a workflow parameter, I will write a separate post.



No comments:

Post a Comment