on 01-23-2012 5:00 PM
Hi SDNers,
I have a requirement to write UDF, can anybody help me in acheiving the code.
Requirement:-
If I am getting 5 as my input to UDF, I need to generate five 001's to my output of UDF.
I tried to loop the input and used result.addValue("001"); but not working.
Please help in getting java logic for this udf.
Thanks
Jayaram.G
chk this:
Exceution type: all values of a context
Input will be "a"
int bb =Integer.parseInt(a[0]);
for(int i=0;i<bb;i++)
{
result.addValue("001");
}
Note: tweak this code to achieve ur functionality
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Make sure that you have set the ResultList as the Java Type of your return parameter. Otherwise, you will not be able to output multiple values. Moreover, you might want to have a look at standard function useOneAsMany, as you might be able to achieve your goal using it.
Hope you'll find this useful,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
so, you need five (001's) for 5 input &
ten(001's) for 10 input.
is this dynamic. can the input be any number??
& do u want output as (001001001001001) for 5 input.
Or do u need it in array output.
pls give a example.
-santosh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I tried to loop the input and used result.addValue("001"); but not working.
Do you use choose function by context or by queue?
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.