Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 1FF609FB7DF for ; Tue, 13 Mar 2007 10:44:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 85450-04-6 for ; Tue, 13 Mar 2007 10:43:59 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [216.148.227.153]) by postgresql.org (Postfix) with ESMTP id 2D76F9FB827 for ; Tue, 13 Mar 2007 10:44:03 -0300 (ADT) Received: from [192.168.0.9] (c-24-17-161-80.hsd1.mn.comcast.net[24.17.161.80]) by comcast.net (rwcrmhc13) with ESMTP id <20070313134400m13007d6gfe>; Tue, 13 Mar 2007 13:44:00 +0000 From: Adrian Klaver To: pgsql-sql@postgresql.org Subject: Re: For loop Date: Tue, 13 Mar 2007 06:44:20 -0700 User-Agent: KMail/1.9.1 References: <45F69D7C.4070304@fastcon.com.br> <45F6B4EB.A3DD.0030.0@indicator.be> <45F6A793.1090904@fastcon.com.br> In-Reply-To: <45F6A793.1090904@fastcon.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200703130644.20870.aklaver@comcast.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/164 X-Sequence-Number: 27802 On Tuesday 13 March 2007 6:30 am, Ezequias R. da Rocha wrote: > I quetion one more time. I must have a function ? Isn't another way to > implement it without using functions ? > > Ezequias > > Bart Degryse escreveu: > > Please post your complete CREATE FUNCTION statement. Error code 42601 > > refers to some syntax error which probably occurs just before you > > start looping. To find it I need to see more code. > > Please don't mail me directly. Only mail to pgsql-sql@postgresql.org > > > > > > >>> "Ezequias R. da Rocha" 2007-03-13 14:19 >>> > > > > They are not working well. > > > > Allways the same error. > > > > (if while) > > ERROR: syntax error at or near "WHILE" > > SQL state: 42601 > > Character: 1 > > > > (if for) > > > > ERROR: syntax error at or near "FOR" > > SQL state: 42601 > > Character: 1 > > > > (if loop) > > ERROR: syntax error at or near "LOOP" > > SQL state: 42601 > > Character: 1 > > I installed the pgsql but I don't think it is a problem of language. > > What could be wrong ? I am not using functions too. I am using the SQL > > tool of PgAdmin III. > > > > Any help would be glad. > > > > Ezequias > > If you want to use plpgsql it needs to be within a function. -- Adrian Klaver aklaver@comcast.net