on ‎2008 May 14 12:28 PM
Hi,
Being am a trainee i didnt understand much about the user-defined functions at my training period..
Will you plz tell about them with best examples as u developed in real time and their requirement in scenario..
I tried for them very much in SDN..that is not statisfactory
Regards
guna
Request clarification before answering.
UserDefined Function types:
Simple functions
*******************
1) process individual field input values for each function call.
2) expect strings as input values
3) return a string.
eg
function myudf(String a, Container container)
{
if (a.equals("Business"))
return "B";
else if (a.equals("Private"))
return "P";
else
return "X";
}
Advanced functions
**********************
1) process nonsingle string field input values for each function call
2) pass either all field values of a context or the whole queue
3) input field is passed as string array
4) returned values are stored in a string array, ResultList
function myudf(String a[], ResultList result, Container container)
{
for(int i=0;i<a.length;i++)
if(!a[<i>].equals(""))
result.addValues(a<i>);
}
=> This is to add non empty values to target structure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.