How to create mapping variable in informatica?
How to change value :
Example 1:Incremental data load
A typical example of mapping variable in informatica, Lets say you get a full file from your source and you are supposed to design your mapping to load only incremental data, precisely the new and updated records after the previous run are to be processed.
Create a mapping variable “$$var_date”
Filter source where create/update date > $$var_date.
Assign $$$sessionstarttime value to var_date. If the session is successful, session start time will be saved to the variable. In the next run the transaction generated after the previous run will only be considered.
Example 2: To pass a value from one session to another.
Use workflow variable to assign the value of mapping variable in informatica in any session and you can access it in to next session through workflow variable. This can be achieved by session properties “Pre-session variable assignment”, and “Post-session on success variable assignment”.
Example 3: You can use it in lookup override where you want to use dynamic sql override, Look up override which can be controlled from parameter file.
We are doing an indirect load of flat file those have the same structure. There is a single target to be appended with this data. Lets say these source files can have Tier1/2/3 sales data that particularly explains the partner type involved in the particular sale,,,, File names will be of this sort.. Filexxxxxxxx_<partnertype>.dat ,,,,,, you predicted that your Lookup SQL can be made unique for every partner type data that will yield a greater performance. So a mapping variable in Lookup override can help to achieve this ——Filename_withoutdat=substr(filename,1,instr(filename,’.’)),,,$$var_lkpsql = substr(filename_withoutdat,instr(filename,’_’),length(filename_withoutdat)),,,,,,
Lookup override – where partner_type = ‘$$var_lkpsql’