on 01-22-2007 9:30 AM
Hi Experts,
The requirement of mapping ia as fallows.
Based on Field1, the Field2 value populates no.of times of the Field1.
Field1 contains 3 , Field2 Contains "AAA".The required output would be as "AAA","AAA","AAA" in three records.Can anyone give the UDF.
Thanks,
Tiger Woods
Hi All,
Thanks a lot for your replies.My problem was solved with function which was given by Venkat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tiger,
Use the function "UseOneAsMany" ...
Cheers,
Himadri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The required output like below but that is for three records.
<target>AAA</target>
<target>AAA</target>
<target>AAA</target>
If Field1 contains value as 5 , then the ouput of Field2 as above(5 times).
Thanks,
Tiger Woods.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Triger,
If you are sepearating your input by using any delimiter like aa,aa,aa then this code will work and it creates the target structure like:
<target>AAA</target>
<target>AAA</target>
<target>AAA</target>
<target>AAA</target>....hw many times you mentioned in your input filed those many times it will get appear in target side.
Note:here a is the argument.
String str=a.split(a[0],",");
for(int i=0;i<a.length;i++)
{
result.addvalue(a<i>)
}
Hope this code will solve your peoblem.
Let me know if you have any queries.
Thanks
Sekhar
Hi,
How would you need the target? Is it some thing like
<target>AAA</target>
<target>AAA</target>
<target>AAA</target>
or
<target>AAAAAAAAA</target>
Regards,
Jai Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Is the output 3 nodes containing "AAA", then go for this UDF.
select queue tyep.
Input:field1, field2
int val = Integer.parseInt(field1[0]);
for(int j=0; j< val; j++){
result.addValue(field2[0]);
}
Regards,
P.Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.