Hi All,
My requirement is I want to pass column name with some value as parameter (Lnk_In.EMP_ID=1234)in transformer constraint.
When I tried with that job is completed successfully, but no records are passing to output.
Could you please help me.
How to parameterize column name in transformer constraint
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 31
- Joined: Fri Aug 01, 2008 2:56 am
-
- Participant
- Posts: 31
- Joined: Fri Aug 01, 2008 2:56 am
My job is like Dataset ---->Transformer--->Dataset
At run time for parameter first time i will give like EMP_ID=123 Or EMP_ID=234 Or EMP_ID=456
when i run second time i will give like EMP_NAME='AAA'
when i run thirs time i will give like GRADE='AA'
depends on the requiremnt i will pass at run time.
How can i do this in transformer. We can do this by using filter stage also.
At run time for parameter first time i will give like EMP_ID=123 Or EMP_ID=234 Or EMP_ID=456
when i run second time i will give like EMP_NAME='AAA'
when i run thirs time i will give like GRADE='AA'
depends on the requiremnt i will pass at run time.
How can i do this in transformer. We can do this by using filter stage also.
The problem with using a job parameter is it takes the value specified and treats as a string. And since the string value that you are passing is not TRUE the rows will not go out. This can be accomplished by doing the following:
First set up 2 Job Parameters; a=column name, b=value
StageVariable1 = If JobParamA = 'name' then link.name else if JobParamA = 'grade' then link.grade else .... (continue on for each column possibility with the ending else = "")
StageVariable2 = if StageVAriable1 = JobParamB then 1 else 0
Then use StageVariable2 as the constraint on the output link.
First set up 2 Job Parameters; a=column name, b=value
StageVariable1 = If JobParamA = 'name' then link.name else if JobParamA = 'grade' then link.grade else .... (continue on for each column possibility with the ending else = "")
StageVariable2 = if StageVAriable1 = JobParamB then 1 else 0
Then use StageVariable2 as the constraint on the output link.