CREATE FUNCTION ERROR
AlokT
Community Edition User
CREATE FUNCTION replaceSpChar (x VARCHAR)
RETURN VARCHAR
AS BEGIN
RETURN REGEXP_REPLACE (x, '[.,;‘`:/*()
?/"&%$!+={}<>]', '') end
END
ERROR 4856: Syntax error at or near "end" at character 128
This manual select works->
select REGEXP_REPLACE ('?' , '[.,;‘`:/*()
?/"&%$!+={}<>]', '')
0
Answers
@AlokT: Semicolon is missing in your CREATE statement before END. Please find working example below
dbadmin=> CREATE FUNCTION replaceSpChar (x VARCHAR) RETURN VARCHAR AS BEGIN RETURN REGEXP_REPLACE (x, '[.,;‘`:/*()?/"&%$!+={}<>]', ''); end;
CREATE FUNCTION
dbadmin=>