Skip site navigation (1) Skip section navigation (2)

code in docs gives me an error

From: "Hicham G(dot) Elmongui" <elmongui(at)cs(dot)purdue(dot)edu>
To: pgsql-docs(at)postgresql(dot)org
Subject: code in docs gives me an error
Date: 2004-10-19 14:21:26
Message-ID: cl37t2$95f$1@news.hub.org (view raw or flat)
Thread:
Lists: pgsql-docs
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

pgsql-docs by date

Next:From: eleinDate: 2004-10-19 20:47:04
Subject: Re: SQL 2003 conformance
Previous:From: Mark DexterDate: 2004-10-18 23:19:48
Subject: UPDATE Query Example

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group