code in docs gives me an error

From: "Hicham G(dot) Elmongui" <elmongui(at)cs(dot)purdue(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: code in docs gives me an error
Date: 2004-10-19 14:56:44
Message-ID: cl39v8$l2r$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi
I tried creating the function (from sec 19.3.1). But it gives me the
following error: "ERROR: type tablename does not exist".
Any ideas of what i might be doing wrong?

CREATE FUNCTION use_many_fields(tablename) RETURNS TEXT AS '
DECLARE
in_t ALIAS FOR $1;
BEGIN
RETURN in_t.f1 || in_t.f3 || in_t.f5 || in_t.f7;
END;
' LANGUAGE 'plpgsql';

Thanks,
--Hicham

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-10-19 15:05:36 Re: About upper() and lower to handle multibyte char
Previous Message Raffaele Spizzuoco 2004-10-19 14:54:36 OID and PK/FK KEYS