X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0EBC2D8B80 for ; Fri, 30 Sep 2005 06:21:41 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 12391-06 for ; Fri, 30 Sep 2005 09:21:37 +0000 (GMT) Received: from pjetlic.mobart.hr (pjetlic.mobart.hr [80.80.51.10]) by svr1.postgresql.org (Postfix) with ESMTP id 06804D8B56 for ; Fri, 30 Sep 2005 06:21:38 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by pjetlic.mobart.hr (Postfix) with ESMTP id 7095317A25 for ; Fri, 30 Sep 2005 11:21:40 +0200 (CEST) Received: from pjetlic.mobart.hr ([127.0.0.1]) by localhost (pjetlic [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15255-03 for ; Fri, 30 Sep 2005 11:21:40 +0200 (CEST) Received: from mike.mobart.hr (mike.mobart.hr [192.168.10.94]) (using SSLv3 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by pjetlic.mobart.hr (Postfix) with ESMTP id 4DBE717438 for ; Fri, 30 Sep 2005 11:21:40 +0200 (CEST) Subject: Re: EXECUTE SELECT INTO... last one! From: Mario Splivalo Reply-To: mario.splivalo@mobart.hr To: pgsql-sql@postgresql.org In-Reply-To: <20050930083434.GA86067@winnie.fuhr.org> References: <1128067235.32604.3.camel@ekim> <20050930083434.GA86067@winnie.fuhr.org> Content-Type: text/plain Organization: Mob-Art Date: Fri, 30 Sep 2005 11:21:50 +0200 Message-Id: <1128072110.32604.7.camel@ekim> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by OpenSource AV+AS Mail Server X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/302 X-Sequence-Number: 22849 On Fri, 2005-09-30 at 02:34 -0600, Michael Fuhr wrote: > 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; Yes, it's my fault. I was testing it on pg7.4. On 8.1beta2 works as you explained. Though it would be realy nice to be able to do var := col FROM tempTable WHERE condition withouth EXECUTE'ing and stuff. Sorry for the fuss I might have created. Mario -- Mario Splivalo Mob-Art mario.splivalo@mobart.hr "I can do it quick, I can do it cheap, I can do it well. Pick any two."