X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id CBFD6D1B53C for ; Sun, 1 Feb 2004 19:41:21 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 81506-08 for ; Sun, 1 Feb 2004 15:41:19 -0400 (AST) Received: from serwer.skawsoft.com.pl (skawina.eu.org [80.48.213.66]) by svr1.postgresql.org (Postfix) with ESMTP id 1F3BDD1B55C for ; Sun, 1 Feb 2004 15:41:18 -0400 (AST) Received: from klaster.net (core-1.citynet.pl [80.48.135.14]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id A38F22B3E9; Sun, 1 Feb 2004 20:41:17 +0100 (CET) Message-ID: <401D56E6.7080700@klaster.net> Date: Sun, 01 Feb 2004 20:43:34 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; pl-PL; rv:1.6b) Gecko/20031208 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Carla Mello Cc: Lista dyskusyjna pgsql-sql Subject: Re: Executing dynamic queries (EXECUTE) References: <013d01c3e4e9$dbe16300$16011aac@widesoft.com.br> In-Reply-To: <013d01c3e4e9$dbe16300$16011aac@widesoft.com.br> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/9 X-Sequence-Number: 16700 Dnia 2004-01-27 16:25, Użytkownik Carla Mello napisał: > > Hello! > > I need to execute a dynamic query and capture your result in a > integer variable. > > I´m using the statement "EXECUTE string", but I don´t obtain to > capture the result of dynamic query. > v_count:= EXECUTE v_query; Documentation: 19.5.4. Executing dynamic queries "The results from SELECT queries are discarded by EXECUTE, and SELECT INTO is not currently supported within EXECUTE. So, the only way to extract a result from a dynamically-created SELECT is to use the FOR-IN-EXECUTE form described later." Regards, Tomasz Myrta