I think the wording of the message text is very specific already. It says that a table function (as in your case because you said that the function shall return a table with two columns) must have exactly one RETURN statement, and that must be placed at the end of the compound statement. You have two RETURN statements in the function body (and none of them seems to return a table).
Originally Posted by pagwu
p.s: ROW functions are only applicable to transform functions for structured types.
The real question is what your function shall return. You can't return an integer if the function is to be created with "RETURNS TABLE ( Metaphone1 CHAR(4), Metaphone CHAR(4) )". You never set the output parameters. Also, your table function inserts something in a table named DMP - what is this for?
(2) For this question, please be kind enough to look at the attached file just to get a picture of what I am trying to accomplish. So, my question is, what are some of the way that I can resolve this error and keep the general pattern of the code logic and process?
I suggest that you have a look here on how to work with relations: http://www.ibm.com/developerworks/db...03stolze1.html I parse strings into pieces with pure relational means (and no procedural logic).
p.s: You should use some indentation to make the code readable.
IBM DB2 Analytics Accelerator
IBM Germany Research & Development