on 04-05-2011 5:18 PM
My question is actually really simply,
Suppose I have a UDF and I want to make a
SELECT name, last_name FROM employee WHERE id = id1
the input is id1 but how do I deal with two outputs when the result can only be 1 string?
I could save it to a global container, but the question is at the end how to map it to the response, or what am I not understanding here?
(without using Graphical JDBC lookups)
request response
msg msg
id1---> UDF --->name -
> name
->last name--> last name
Thanks a lot!
JDBC Graphical lookup is user friendly. You can avoid these problems.
In your case, YOu return single string. suggestion. Concatanete first name and last name using separtor and return as one string. After return use some standard java function to split the string in to first and last name.
Snippet code
// in your jdbc udf
String concat=firstName+":" +lastName;
return concat;
When you map the string to target fields ...
Create UDF or use text functions to achieve this
int pointer = concat.indexOf(":");
firstName = concat.substring(0, pointer);
lastName = concat.substring(pointer+1);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your answers,
What I was actually looking for, and could find was that it is possible to return 2 objects ResultList from a UDF, which I didn't know.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
UDF is typical java method and mapping is a class. So in MM go to Function tab and in init method create some variable. Then in your udf you can assign this variable using:
this.var1 = value;
and than reuse it later in other udf.
Kind Regards
Maciej
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
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.