X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 8690F9FA61D for ; Wed, 5 Jul 2006 15:08:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 02032-09 for ; Wed, 5 Jul 2006 15:08:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.99main.com (mail.99main.com [208.28.184.11]) by postgresql.org (Postfix) with ESMTP id 60D319FA4A8 for ; Wed, 5 Jul 2006 15:08:25 -0300 (ADT) Received: from 99main.com (localhost [127.0.0.1]) by mail.99main.com (8.12.8+Sun/8.12.8) with ESMTP id k65I8JT7022275 for ; Wed, 5 Jul 2006 14:08:23 -0400 (EDT) From: "Keith Worthington" To: PostgreSQL SQL Reply-To: KeithW@narrowpathinc.com Subject: Re: "CASE" is not a variable Date: Wed, 5 Jul 2006 14:08:19 -0400 Message-Id: <20060705180422.M54977@narrowpathinc.com> In-Reply-To: <44A2C0EF.3@presinet.com> References: <20060628154728.M33440@narrowpathinc.com> <21800.1151511389@sss.pgh.pa.us> <20060628173010.M51266@narrowpathinc.com> <44A2C0EF.3@presinet.com> X-Mailer: Open WebMail 2.50 20050106 X-OriginatingIP: 68.235.22.242 (npkeithw) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/48 X-Sequence-Number: 25622 On Wed, 28 Jun 2006 10:48:31 -0700, Bricklen Anderson wrote > Keith Worthington wrote: > >>> "Keith Worthington" writes: > >>> The following is a section of code inside an SQL function. > >> On Wed, 28 Jun 2006 12:16:29 -0400, Tom Lane wrote > >> SQL, or plpgsql? It looks to me like misuse of the plpgsql INTO clause > >> (there can be only one). > >> > >> regards, tom lane > > > > plpgsql > > > > This is part of a function inside a v8.0.2 database. > > > > I didn't realize that the INTO clause was only limited to one instance. I was > > trying to accomplish > > > > SELECT col_a INTO var1, > > col_b INTO var2, > > col_c INTO var3, > > ... > > FROM foo > > WHERE fobar; > > > > Kind Regards, > > Keith > > try it like > select col_a,col_b,col_c INTO va1,var2,var3 .... > > not sure if 8.0.2 allows you to do that, however. Apparently it does. Just to wrap up this thread and hopefully help the next person. When SELECTing multiple values into variables only use one instance of the INTO clause. i.e. SELECT col_a, col_b, col_c INTO var1, var2, var3 FROM foo WHERE fobar; Kind Regards, Keith