Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 3A5429FB2D8 for ; Thu, 18 Jan 2007 03:39:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 09853-03 for ; Thu, 18 Jan 2007 03:38:51 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from cicero1.cybercity.dk (cicero1.cybercity.dk [212.242.40.4]) by postgresql.org (Postfix) with ESMTP id D82D49FB2C9 for ; Thu, 18 Jan 2007 03:38:58 -0400 (AST) Received: from agile.dk (0x3e42da3b.adsl.cybercity.dk [62.66.218.59]) by cicero1.cybercity.dk (Postfix) with ESMTP id 48B5A63F776; Thu, 18 Jan 2007 08:38:56 +0100 (CET) Received: from mail.agile.dk (localhost [127.0.0.1]) by agile.dk (Postfix) with ESMTP id F393AB0D39; Thu, 18 Jan 2007 08:38:55 +0100 (CET) Received: from 82.143.192.130 (SquirrelMail authenticated user jma@agile.dk) by mail.agile.dk with HTTP; Thu, 18 Jan 2007 08:38:56 +0100 (CET) Message-ID: <62559.82.143.192.130.1169105936.squirrel@mail.agile.dk> In-Reply-To: <2AFADCD2-C72D-40FB-8B8E-D6FD023F2148@pgedit.com> References: <1364.62.66.218.59.1169073199.squirrel@mail.agile.dk> <2AFADCD2-C72D-40FB-8B8E-D6FD023F2148@pgedit.com> Date: Thu, 18 Jan 2007 08:38:56 +0100 (CET) Subject: Re: Some help with functions-syntax From: "Jan Meyland Andersen" To: "John DeSoi" Cc: "Jan Meyland Andersen" , pgsql-sql@postgresql.org User-Agent: SquirrelMail/1.4.4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.051 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200701/74 X-Sequence-Number: 27226 > There are two forms to iterate over the query: > > 1. FOR target IN query LOOP > 2. FOR target IN EXECUTE text_expression LOOP Thanks for your answer. > My suggestion is to eliminate the string you created (_WHERECLAUSE) and > add the proper conditions to the query expression you already have. But the problem here is that the where-clause depends on the relkind. That is why I'm trying to solve the problem this way. How do I then write EXECUTE queries on multiple lines, if I go with this solution? Regards Jan