X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 0D8BC9FB346 for ; Thu, 20 Jul 2006 17:59:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 57725-03-2 for ; Thu, 20 Jul 2006 20:59:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web31802.mail.mud.yahoo.com (web31802.mail.mud.yahoo.com [68.142.207.65]) by postgresql.org (Postfix) with SMTP id 497A79FB573 for ; Thu, 20 Jul 2006 17:25:31 -0300 (ADT) Received: (qmail 41549 invoked by uid 60001); 20 Jul 2006 20:25:30 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=HE/5mXTAX6kl8GEvEy2eEdwOvfnMluVEgyVp+UFUlzoeT4+yYOGfI13A4Gj9de+eUROK0gR5TLeb9TV6e3PF0d0LYlBdBrdYGnkDZfzGiaWFhe4iVIl+5j8KlQdcef7mn8WH0JYstJJAQGnuvqroUr0Oe3vJT9Rayy+jH0Tx3EQ= ; Message-ID: <20060720202530.41547.qmail@web31802.mail.mud.yahoo.com> Received: from [63.203.180.122] by web31802.mail.mud.yahoo.com via HTTP; Thu, 20 Jul 2006 13:25:30 PDT Date: Thu, 20 Jul 2006 13:25:30 -0700 (PDT) From: Richard Broersma Jr Subject: Re: Error when trying to use a FOR loop To: Kevin Nikiforuk , pgsql-sql@postgresql.org In-Reply-To: <6EA72AC41F81D242A38AAF505523A94D022DF2@kappa.acrodex.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200607/266 X-Sequence-Number: 25840 > Sorry if this is in the archives, but I've done a search and couldn't find anything relevant. > I'm running HP's precompiled version of 8.1.3.1 as part of their Internet Express offering, and > I can't seem to run a for loop. Here's what I'm seeing: > xp512-0715-0716=# FOR LV in 1..10 LOOP > xp512-0715-0716-# select * from ldevrg; > ERROR: syntax error at or near "FOR" at character 1 > LINE 1: FOR LV in 1..10 LOOP The following is give examples of control structures. However, you need to be sure that your version of postgresql has a procedural language installed. If not, you will need to install it. http://www.postgresql.org/docs/8.1/interactive/plpgsql-control-structures.html#PLPGSQL-CONTROL-STRUCTURES-LOOPS Use can use createlang to add different languages to postgresql. http://www.postgresql.org/docs/8.1/interactive/sql-createlanguage.html The following link gives a shot list of languages that you can use. There are others however: http://www.postgresql.org/docs/8.1/interactive/server-programming.html see Server-side Procedural Languages from: http://www.postgresql.org/download/ Hope this help. Regards, Richard Broersma Jr.