The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.
Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!
CREATE FUNCTION ERROR

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=>