Hi. Can anyone tell me what's wrong with the following:
create function test.abcdef(c7 char(7)) returns date
language sql
begin
return(
CASE
WHEN c7 = ' ' THEN '0001-01-01'
WHEN c7 = '0000000' THEN '0001-01-01'
WHEN c7 IS NULL THEN '0001-01-01'
ELSE
tsg.century(SUBSTR(c7,1,1))
concat SUBSTR(DIGITS(c7),5,2) concat '-'
concat SUBSTR(DIGITS(c7),1,2) concat '-'
concat SUBSTR(DIGITS(c7),3,2)
END
);
end
Error msg is: SQL -204
Any ideas?
Thanks ..