Re: EXECUTE SELECT INTO... last one!

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Mario Splivalo <mario(dot)splivalo(at)mobart(dot)hr>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: EXECUTE SELECT INTO... last one!
Date: 2005-09-30 08:34:34
Message-ID: 20050930083434.GA86067@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Sep 30, 2005 at 10:00:35AM +0200, Mario Splivalo wrote:
> PgSql8.1beta2 gives me this:
>
> ERROR: EXECUTE of SELECT ... INTO is not implemented yet
> CONTEXT: PL/pgSQL function "_rndbroj" line 5 at execute statement

Could you post a simple example of what you're trying to do? The
following works for me in 8.1beta2 (from CVS):

CREATE FUNCTION mycount(text) RETURNS bigint AS $$
DECLARE
query text;
cnt bigint;
BEGIN
query := 'SELECT count(*) FROM ' || quote_ident($1);
EXECUTE query INTO cnt;
RETURN cnt;
END;
$$ LANGUAGE plpgsql;

SELECT mycount('pg_class');
mycount
---------
188
(1 row)

--
Michael Fuhr

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mario Splivalo 2005-09-30 09:21:50 Re: EXECUTE SELECT INTO... last one!
Previous Message Mario Splivalo 2005-09-30 08:00:35 EXECUTE SELECT INTO... last one!