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 52EDFD1CB0F for ; Mon, 2 Feb 2004 10:35:05 +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 35916-01 for ; Mon, 2 Feb 2004 06:35:00 -0400 (AST) Received: from hidrogenio.widesoft.com.br (hidrogeniov5.widesoft.com.br [200.246.206.17]) by svr1.postgresql.org (Postfix) with ESMTP id 2F65CD1CACD for ; Mon, 2 Feb 2004 06:34:57 -0400 (AST) Received: from wsbd01 (startx.widesoft.com.br [200.246.206.56]) by hidrogenio.widesoft.com.br (Postfix) with SMTP id EE95635D4FE; Mon, 2 Feb 2004 08:34:42 -0200 (BRDT) Message-ID: <001501c3e978$7fbdd340$16011aac@widesoft.com.br> From: "Carla Mello" To: "Tomasz Myrta" Cc: "Lista dyskusyjna pgsql-sql" References: <013d01c3e4e9$dbe16300$16011aac@widesoft.com.br> <401D56E6.7080700@klaster.net> Subject: Re: Executing dynamic queries (EXECUTE) Date: Mon, 2 Feb 2004 08:37:03 -0200 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-2" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/38 X-Sequence-Number: 16729 Hello Tomasz, I´m going to study the FOR-IN-EXECUTE statement and to try again. Thanks, Carla Mello ----- Original Message ----- From: "Tomasz Myrta" To: "Carla Mello" Cc: "Lista dyskusyjna pgsql-sql" Sent: Sunday, February 01, 2004 5:43 PM Subject: Re: [SQL] Executing dynamic queries (EXECUTE) > 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