on 06-22-2010 2:14 PM
Hi,
I have 13 source fields with different names, like HitoryType1 to HistoryType13 I need to map these all fields into single target field. I am currently using the in built concate function, but i am interested to use UDF. Pls help me with the UDF code for the same.
pls feel free to ask in case of any clarification before UDF code.
-SS
write udf like this..
String out = f1 + f2 +f3 ..... + f13;
return out;
where f1, f2, .... f13 are 13 input fields which you will pass to UDF argument.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> Sarvesh,
>
> thnx for quick reply, but in that case we need to pass all 13 fields as input parameter to the UDF ... right ?
> do we have any other option available ?
>
> waiting
>
> -SS
You have two options;
1. Go for standard graphical mapping concat function (but with 13 fields this will look too much of an art once done)
2. simply go for the udf by sarvesh
note than in either case you WILL have to provide all the 13 source fields as input
hi all,
I understand that without input system can't understand the strings. but i was thinking to have a inbuilt functionality like context or array or somethign else which will take fields by reference.
Currently I am using the "Concat" function this is going to use in m nay places in different interfaces .... so i thought of making a reusable function (UDF). Thanks Sarveh, Vijay for the inputs.
thanks to all. I am looking for a more precise solution (if possible) else Sarvesh's approach is fine with me.
-SS
>>have 13 source fields with different names, like HitoryType1 to HistoryType13 I need to map these all fields into single target field. I am currently using the in built concate function,
What is wrong with the standard concatenate option?
>>but i am interested to use UDF
Why? And what is wrong with the code given by Sarvesh?
You just dont "like" it?
Regards
Jai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.