on 08-14-2011 2:54 AM
Hi,,
i am new to java coding..can you help me on this.i am sending source some xml structure to mail as attachment.so i am concatenating all these source value and sending it to cMT_INPUT..here is my source structure.
MT_INPUT 1-1
Record_rows 0-unbound
name 1
empid 1
marks 1
i need to pass this structure to udf as three arguements or shall i go for counting the root node ..like how to proceed udf requied..
i have writeen some logic like this
Public void getcontent(String name[],String empid[],String marks[],ResultList result,Container container)
{
String str="";
int i=name.length();
for (int j=0;j,len;j++)
{
str=str+name<i>;
str=str+empid<i>;
str=str+marks<i>;
}
result.addValue(str);
}
here output i am getting like rajesh,1001,90..
only one record i am getting
how to get mulitiple records...
help is needed in coding.
Thanks
Allamudi
chk this:
input wiil be : var1, var2,var3, var4
Execution type: all values of a context.
int a= var1.length;
String concat ="";
for(int i=0;i<a;i++)
{
concat=concat + var2<i> + "," +var3<i>+","+ var4<i>+ ",";
}
//substring function is used to remove the last "," from the concatenated output
int b=concat.length();
String output = concat.substring (0,b-1);
result.addValue(output);
mapping:
Record_rows----
name--------------remove context
empid----------------remove context------------UDF-----Traget
marks------------removecontext
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
here output i am getting like rajesh,1001,90..
only one record i am getting
how to get mulitiple records...
help is needed in coding.
By multiple records you mean after concatting the three nodes it will be a next value? If so, do it like this
Public void getcontent(String name[],String empid[],String marks[],ResultList result,Container container)
{
int i=name.length();
for (int j=0;j,len;j++){
String str="";
str=str+name[j];
str=str+empid[j];
str=str+marks[j];
result.addValue(str);
}
}
You could also do it via the standard text function concat
name -> concat -> concat -> target
empid -> / marks -> /
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.