Please see this example:
CREATE FUNCTION SPCATTN( SPC1 CHAR(1), SPC2 CHAR(1), SPC3
CHAR(1) )
RETURNS
CHAR(1)
LANGUAGE
SQL
BEGIN
RETURN(
CASE
WHEN ( (SPC1 = '5') OR (SPC2 = '5') OR (SPC3 = '5') ) THEN
'5'
WHEN ( (SPC1 = 'P') OR (SPC2 = 'P') OR (SPC3 = 'P') ) THEN
'P'
ELSE
'NULL'
END
);
END
--then i try to invoke the function here
SELECT DBACCT, SPATTN(DBVIPS, DBVIPS2, DBVIPS3), etc......
Thanks for your help.
Regards, Chuck
--
All comments provided "as is" with no warranties of any kind
whatsoever and may not represent positions, strategies, nor views of my
employer