Trouble with PL/pgSQL

Started by Kevin Willemsabout 25 years ago2 messagesgeneral
Jump to latest
#1Kevin Willems
kdwillems@hotmail.com

I wrote the following test function:

CREATE FUNCTION tester(text)
RETURNS text
AS 'DECLARE
str text;
BEGIN
str := upper($1);
RETURN str;
END;'
LANGUAGE'plpgsql'

This runs OK. However, when I go to use it as follows:

SELECT tester('sometext');

I get the error:

NOTICE: plpgsql: ERROR during compile of tester near line 1
"RROR: parse error at or near "

Does anyone know why this is happening? Any help would really be
appreciated.

- Kevin Willems

#2Joel Burton
jburton@scw.org
In reply to: Kevin Willems (#1)
Re: Trouble with PL/pgSQL

On Tue, 3 Apr 2001, Kevin Willems wrote:

I wrote the following test function:

CREATE FUNCTION tester(text)
RETURNS text
AS 'DECLARE
str text;
BEGIN
str := upper($1);
RETURN str;
END;'
LANGUAGE'plpgsql'

This runs OK. However, when I go to use it as follows:

SELECT tester('sometext');

I get the error:

NOTICE: plpgsql: ERROR during compile of tester near line 1
"RROR: parse error at or near "

If this is the actual function you used, then you need a space between
LANGUAGE and 'plpgsql';

--
Joel Burton <jburton@scw.org>
Director of Information Systems, Support Center of Washington