on 03-24-2015 5:12 AM
Sateesh
You can try the logic below with a UDF of Execution type "All Values of Queue", with a single input a
StringBuilder sb = new StringBuilder();
for (int i = 0; i < a.length; i++) {
sb.append("||").append(a[i]);
}
sb.append("||");
result.addValue(sb.toString());
Test results
You can adjust the logic accordingly if you need further tweaking.
Rgds
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eng,
Thanks for your help to solve my problem,
With this UDF I achieved the result what I was expect.
But at that same time I got to know the value of parameter should not pass more 4000 characters.if the value more than 4000 characters with last value of field, then it doesn't take last field value and create to next statement.
(or)
I need to this UDF upto 5 values collection then again new statement create with 5 values then again repeat upto end.
Do I get possible edit this UDF to achieve this result?
Thanks in Advance.
Best Regards,
Sateesh
Sateesh
Try with the following and adjust accordingly to your requirement.
StringBuilder sb = new StringBuilder();
for (int i = 0; i < a.length; i++) {
sb.append("||").append(a[i]);
if(((i+1) % 5) == 0) {
sb.append("||");
result.addValue(sb.toString());
if(i != a.length) {
result.addContextChange();
}
sb.setLength(0);
}
}
if(sb.length()!=0) {
sb.append("||");
result.addValue(sb.toString());
}
Rgds
Eng Swee
Sateesh
You need to also adjust the mapping as well for the target parent segment storedProcedureName.
Create another UDF of execution all values of queue with the following logic
for (int i = 0; i < a.length; i++) {
if((i % 5) == 0) {
result.addValue("");
}
}
Your mapping logic should look like that - I've named the second UDF parent but you can choose whatever name you like.
After executing the entire mapping, it would look like that
If you want to, it is also possible to combine the two UDFs into a single one with two outputs, but I leave that to you if you desire so.
Rgds
Eng Swee
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
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.