Database Reference
In-Depth Information
The parameter file - parameters and
variables
It is always a best practice of coding that you should never hardcode the values. The same
applies to Informatica as well. It is always better to pass the values using parameters or
variables instead of hardcoding them. When you define parameters or variables in the code,
you need to pass the values to those parameters and variables. Parameter files serve this
purpose. Any value that you hardcode can be passed through a parameter file. You can
define the parameter file at the session level and the workflow level.
You must have noticed the system defined $PMSourceFileDir\ or $PMTar-
getFileDir\ variables. Similar to them, we can define the user-defined variables. You
can define the variable at both the mapping level and the workflow level.
Note
If the value that is passed remains constant across the session run, it is called the parameter,
and if the value changes across the session run, it is called the variable.
Let's take a look at an example to understand the parameter file. You are aware that Inform-
atica has three different repositories to cater to the need of three regions. Let's say we have
three repositories— REPO_DEV , REPO_TEST , and REPO_PROD —that serve develop-
ment, testing, and production regions, respectively. Also, we have three Oracle databases
corresponding to three regions, which are ORACLE_DEV , ORACLE_TEST , and
ORACLE_PROD , respectively. When you start the coding in the development region under
REPO_DEV , you will hardcode the database connection value to ORACLE_DEV . Your code
is working successfully, and when you want to deploy the code to the test region, you will
need to manually replace the database connection value with ORACLE_TEST . Changing
the code after the testing is not allowed. The same case applies when you wish to deploy
the code from the test to the production.
The solution comes as a parameter file. Parameter files serve the purpose of passing the
value based on the region in which you are running the code. We are defining the parameter
file to pass the value for the source database connection ( $DBCONNECTION1 ), target file
name ( $TGTFILENAME ), e-mail recipient ( $EMAILUSER ), and a mapping-level variable
for location ( $$LOCATION ). We are using examples of a session-level variable, workflow-
level variable, and mapping-level variable so that you understand clearly how they work.
Search WWH ::




Custom Search