Re: ERROR: query has no destination for result data

From: Bartosz Dmytrak <bdmytrak(at)gmail(dot)com>
To: Peter Kroon <plakroon(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: ERROR: query has no destination for result data
Date: 2012-11-23 10:41:51
Message-ID: CAD8_UcYkm7CR71_J7WpjS48tnQTuBCPNxB=N97GxJWW35w3K9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
according to doc: http://www.postgresql.org/docs/9.2/static/sql-do.html
DO returns void:
*"The code block is treated as though it were the body of a function with
no parameters, returning void."*
*
*
Regars
Bartek

Pozdrawiam,
Bartek

2012/11/23 Peter Kroon <plakroon(at)gmail(dot)com>

> 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
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2012-11-23 10:42:43 Re: w7 vs linux
Previous Message Peter Kroon 2012-11-23 10:36:59 ERROR: query has no destination for result data