Re: ERROR: query has no destination for result data

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Gavan Schneider <pg-gts(at)snkmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ERROR: query has no destination for result data
Date: 2012-11-24 15:11:14
Message-ID: 50B0E392.3070609@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/24/2012 12:46 AM, Gavan Schneider wrote:
> On Friday, November 23, 2012 at 21:36, Peter Kroon wrote:
>
>> Hello,
>>
>> I wish to return the SELECT statement.
>> Ho can I achieve this?
>>
> DO $$
>
> DECLARE v_some_id int=14;
>
> BEGIN
> /*
> more queries here...
> */
> SELECT 'this is text';
> END
> $$ LANGUAGE plpgsql;
>>
>> Best,
>> Peter Kroon
>>
> Reinterpreting the question and taking the pseudocode semi-literally is
> the following closer to what was asked?

The rub is that the OP wants to do this in a DO block which rules out
using RETURN.

>
> Regards
> Gavan
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christian Hammers 2012-11-24 17:03:32 Re: 9.1 to 9.2 requires a dump/reload?
Previous Message Rafal Pietrak 2012-11-24 14:48:06 Re: sefety of passwords for web-service applications