I am trying to write a function in DB2 and the function will parse a certain string based on delimiter and return as seperate fields .
The string I should pass will come from another query ,
CREATE FUNCTIONSPLIT_STRING (varchar string)
RETURNS TABLE or row ( string1 VARCHAR(100),string2 VARCHAR(100))
RETURN values (tempstring,tempstring1);--
Now can I call this function and pass a set of strings like select somestring from table ? or use the same query select somestring from table in the function and iterate through it ?