Re: "CASE" is not a variable - Mailing list pgsql-sql

From Bricklen Anderson
Subject Re: "CASE" is not a variable
Date
Msg-id 44A2C0EF.3@presinet.com
Whole thread Raw
In response to Re: "CASE" is not a variable  ("Keith Worthington" <keithw@narrowpathinc.com>)
Responses Re: "CASE" is not a variable
List pgsql-sql
Keith Worthington wrote:
>>> "Keith Worthington" <keithw@narrowpathinc.com> 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.


pgsql-sql by date:

Previous
From: "Keith Worthington"
Date:
Subject: Re: "CASE" is not a variable
Next
From: "Aaron Bono"
Date:
Subject: Re: generate_series with left join