It should work. What is the error / warning you getting?
Try to excape all the ' charachter with /.
Shouldn't you be having ' before the sting as well??
Passing a string parameter with ' characters
Moderators: chulett, rschirm, roy
I had exactly the same issue. It seems the DB2 stage likes to strip the quote character - naughty, naughty. I resolved it as follows:
Parameter value did not include the single quotes e.g.
Param=One,Two,Three
My job was being called from a sequence. In the parameter value expression I used the following:
"\'":Ereplace (Param, ",", "\',\'"):"\'"
It looks a bit confusing because of the mixture of double and single quotes, but essentially it is replacing each ,<comma> with ','<single quote><comma><single quote> and prefixing/suffixing with '<single quote>
If you only have a single job you may have to wrap it with a sequence to allow this kind of parameter pre-processing.
Hope this helps.
Parameter value did not include the single quotes e.g.
Param=One,Two,Three
My job was being called from a sequence. In the parameter value expression I used the following:
"\'":Ereplace (Param, ",", "\',\'"):"\'"
It looks a bit confusing because of the mixture of double and single quotes, but essentially it is replacing each ,<comma> with ','<single quote><comma><single quote> and prefixing/suffixing with '<single quote>
If you only have a single job you may have to wrap it with a sequence to allow this kind of parameter pre-processing.
Hope this helps.
-
- Participant
- Posts: 36
- Joined: Thu Sep 01, 2005 5:44 am
- Location: Canada
Thank you very much OddJob. Your solution worked for me.
But later I found that I got messed up because the $PROJDEF variable assigning the default value which was wrong.
In my case the starting and ending single quotes are given in the query itself as you can see
select name, id from emp where name in ( ' #name_param# ' )
so only the rest of the single quotes needs to be taken care. Now I find that my original job itself works without wrapping it in a sequencer.
Thanks once again.
But later I found that I got messed up because the $PROJDEF variable assigning the default value which was wrong.
In my case the starting and ending single quotes are given in the query itself as you can see
select name, id from emp where name in ( ' #name_param# ' )
so only the rest of the single quotes needs to be taken care. Now I find that my original job itself works without wrapping it in a sequencer.
Thanks once again.
Thanks & Regards,
Rony
Rony