- Learning Informatica PowerCenter 9.x
- Rahul Malewar
- 335字
- 2021-08-06 19:41:29
I hate hardcoding – parameters and variables
When you work on any technology, it is always advised that your code be dynamic. This means that you should use the hardcoded values as less as possible in your code. It is always recommended that you use the parameters or the variable in your code so that you can easily pass these values and don't need to change the code frequently. We will discuss this concept in more detail in the Parameters file section in Chapter 5, Using the Workflow Manager Screen – Advanced.
In this section, we will discuss how to use parameters and variables on the PowerCenter Designer screen.
The value of a variable can change between the session run. The value of a parameter will remain constant across the session runs. The difference is very minute, so you should define parameters and variables properly, as per your requirements.
Consider a filter transformation where you have defined the filter condition as LOCATION='USA'
. As you have used hardcoded values in the filter conditions, it is always recommended that you pass the value using a parameter or variable.
Follow these steps to use variables or parameters:
- In the designer, navigate to Tools | Mapping Designer | Mapping | Parameters and Variables, as shown in the following screenshot:
- A new window will pop up allowing you to provide parameters and variables, as shown in the following screenshot. Add a new parameter or variable depending on your requirement. For our reference, we are creating a
$$LOCATION
.$$
parameter that is used as a mapping level variable or parameter. From the dropdown, you can choose whether you wish to make it a parameter or a variable. Then, click on OK. - Once you define the parameter or variable at the mapping level, you can use them in the transformations. Take a look at the following screenshot:
With this, we have defined a parameter or a variable at the mapping level and used it in the transformations in order to avoid hardcoding.
- 一本書學內部審計:新手內部審計從入門到精通
- Pentaho Business Analytics Cookbook
- Mastering System Center Configuration Manager
- 會計信息化基礎(金蝶版)
- 企業能源審計與節能規劃
- 項目管理(第二版)
- Learning Microsoft Azure
- 財務建模與綜合估值:數據研磨、模型校準、動態估值
- Salesforce Essentials for Administrators
- 企業并購審查中的相關市場界定:理論與案例
- PMP備考寶典:路晨帶你去通關
- 內審兵法
- Stata統計分析與行業應用案例詳解(第2版)
- 中國國內生產總值核算問題研究
- 效益實現管理實踐指南