Can someone assist with a UDF script that calls a a Java or C++ routine to return DoubleMetaphone Keys?

Hi all,
I am in need of examples of a UDF scalar function that can call a Java or C++ routine to return the DoubleMetaphone keys for a name search or something like that. I have never written a UDF let alone one that call another routine so please provide as much  as possible  detail explanation of what the code is doing. This is rather urgent for a report I hae to prep for Monday. I will appreciate a good and helpful response soon.

Thank you all very much  
EnudaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mrfixit22Commented:
0
momi_sabagCommented:
in which language do you want to write the udf?
0
EnudaAuthor Commented:
Hi momi sabag,
The language is SQL...
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

momi_sabagCommented:
why not writing the entire thing in java or C++ and make your life eaiser?
0
EnudaAuthor Commented:
Hello again momi_sabag,
Thanks for your response here...I do need to get this solution ready by tomorrow. First, bear in mind I am working from a osition of relative ignorance of which language is easier to implement or maintain. As I said, this is my first foray into the land of UDF and its usage. I will love to be able to present the options for java ans C++. I read up about this Lawrence Phillip C++ double metaphone script and I think that is what my manger want to be able to call from a UDF. Why, I don't really know. But my task is to show it can be done. And from all that I have read so far, it seem this is doable, right?
Now, if I can be able to also show that, according to your statement that it can be more efficiently done in Java or C++, I will certainly like to have those solutions available to show how with the working example I may find.
The long and short of it is that I will appreciate what you can ponit me to.  If you have have or know of both java and C++ examples, please go ahead and point me to it. Important in this also is how to use the java or C++ versions if possible. The idea is to be able to call this routines for a phonetic name/word search from an application of some sort. My job is to make the routine available and how it is used is up to the developers...I hope you can see where I am comming from...

Thanks
Enuda
0
momi_sabagCommented:
when you create a udf you can specify that it is an external function and you need to point db2 to the file that contains the actual implmentation, after you get that straight, the implementation of the function is just like any other program in the language you choose
read about it here
http://publib.boulder.ibm.com/infocenter/db2luw/v8//topic/com.ibm.db2.udb.doc/admin/r0004461.htm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EnudaAuthor Commented:
Hello all,
I have gotten this far and now I am having problem building/registering the following UDF using the DB2 UDB Development Center. Anyone see something wrong with it? When I change the code a little bit to say JAVA, it build successfully but when it says Language C, it fails to build. Is there a keyword(s) I should or shouldn't use for language = C? Here are the UDF code:

 LANGUAGE C:   This fails
CREATE FUNCTION DMPHONECppScalar ( CWORD  VARCHAR(50))
     RETURNS Varchar(50)
     SPECIFIC DMPHONECppScalar
     EXTERNAL NAME 'CppUDFs!DoubleMetaphone'
     LANGUAGE C
     PARAMETER STYLE SQL
     DETERMINISTIC
     FENCED
     NOT NULL CALL
     NO SQL
     NO EXTERNAL ACTION  

 LANGUAGE Java:   This build successfully.
CREATE FUNCTION DMPHONEJavaScalar ( JWORD  VARCHAR(50))
     RETURNS Varchar(50)
     FENCED
     LANGUAGE JAVA
     PARAMETER STYLE JAVA
     SPECIFIC DMPHONEjAVAScalar
     EXTERNAL NAME 'javaUDFs.DoubleMetaphone'
     NO EXTERNAL ACTION
     CALLED ON NULL INPUT
     DETERMINISTIC
     NO SQL


0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB2

From novice to tech pro — start learning today.