Please help, can't figure out what's wrong with this function...

From: Moritz Bayer <moritz(dot)bayer(at)googlemail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Please help, can't figure out what's wrong with this function...
Date: 2005-09-12 12:14:22
Message-ID: c244500b05091205145a641ec7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

....
Hello group,
I 've written the following function:
CREATE OR REPLACE FUNCTION "public"."getstadtlandflussentrybyid" (integer)
RETURNS SETOF "public"."ty_stadtlandflussentry" AS'
DECLARE objReturn ty_stadtlandflussentry;
DECLARE iid integer;
BEGIN
iid := $1;
for objReturn IN
SELECT ste_id, ste_type, ste_name, ste_firstwrongname, ste_secondwrongname,
ste_description, ste_online
FROM tbl_stadtlandflussentry WHERE ste_id=iid
loop
RETURN next objReturn;
END LOOP;
RETURN;
END;
'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
When I try to execute the function by calling
SELECT getstadtlandflussentrybyid(1);
I get the following error:
ERROR: missing .. at end of SQL expression
I haven't figured out what this message wants to tell me and why it is
thrown at all.
Maybe someone can give me a hint,
Thanks in advance,
Moritz
PS: the function should run under postgres 7.4 and created the following
type:
CREATE TYPE "public"."ty_stadtlandflussentry" AS (
"ste_id" BIGINT,
"ste_type" INTEGER,
"ste_name" VARCHAR(100),
"ste_firstwrongname" VARCHAR(100),
"ste_secondwrongname" VARCHAR(100),
"ste_description" TEXT,
"ste_online" INTEGER
);

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message John DeSoi 2005-09-12 12:46:49 Re: Please help, can't figure out what's wrong with this function...
Previous Message wendell 2005-09-12 03:07:44 Re: howto insert dynamic value