cancel
Showing results for 
Search instead for 
Did you mean: 

Reg., User Defined Function

Former Member
0 Kudos

Hi Experts,

I have created sample User Defined Function for adding FirstName and LastName and displays or returns FullName.

1. Issue One

As I am new to Java, I had tried to write the code as follows. (After clicking on Function icon in Design.

Passed 2 strings as parameters a, b.

String delim = "-"

String full;

full = a + delim + b;

return full;

After testing in 'Test' tab, i am getting the following error.

--> Error

incompatible types found :

char required: java.lang.String String delim = '-';

^ 1 error

<<-- Error end

I have created Two data types

DT_Input (with FirstName, LastName)

DT_Output (with FullName)

Now i would like to create for example 'MyConcatTest' UDF which takes the input parameters as FirstName, LastName and concatenates and should display the FullName in the Outout.. This is my basic requirement in creating the UDF.

Can some one provide the correct Java code which I need to use in my UDF.

2 . Issue Two

I have created MyConcatTest UDF. Now I would like to change the code in that UDF. So how can I edit this UDF again to update the java code.

Could someone please answer this.

Thanks in advance.

Sree

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi sree,

u can edit ur function....beside ur function there is small triangle ...click on that...it give 3 options... add, edit fun,delete fun.

but for adding 2 strings there no need to write UDF.... we hv allready given function..concat in text category.... u can use that.

Thanks,

Maheshwari.

Former Member
0 Kudos

Hi Maheshwari

Thank you for your answer. I am able to modify my function now.

Points awarded.

Sree

Former Member
0 Kudos

Closing the thread

Answers (1)

Answers (1)

Former Member
0 Kudos

First check your code "-" or '-', first is string and second is char. String is Object which gives you operator overloading to add another string into it. read Java API for more information.

<i>String delim;

delim = "-";

full = first + delim + last;</i>

Refer to Java online API for detail information and example.

http://java.sun.com/j2se/1.4.2/docs/api/

You can

Regards,

Gourav

---

<i>Reward points if it helps you</i>

Message was edited by:

Gourav Khare

Former Member
0 Kudos

Gourav

Thank you for the java link. It is helpful.

Sree