Hi!
I am a bit stuck (DB2 9.5)
here is my UDF
Code:
CREATE FUNCTION myfunc( a varchar(1), b varchar(1) ) returns varchar( 1 )
DETERMINISTIC NO EXTERNAL ACTION
BEGIN ATOMIC
DECLARE tmpstr varchar(2);
DECLARE result varchar(1);
SET tmpstr = a||b;
SET result = select col from table where refcol like '%'||tmpstr||'%';
RETURN result;
END
and here is the error which I am getting:
SQL0132N A LIKE predicate or POSSTR scalar function is not valid because the first operand is not a string expression or the second operand is not a string
any ideas how I could properly cast the inputs so that I can use LIKE in this way??