Re: ERROR: query has no destination for result data - Mailing list pgsql-general

From Peter Kroon
Subject Re: ERROR: query has no destination for result data
Date
Msg-id CAOh+DOnAcoHrV60jz4_Cwd2WBHdZa+QYg46tDYPKzh2DzJD5jw@mail.gmail.com
Whole thread Raw
In response to Re: ERROR: query has no destination for result data  (Bartosz Dmytrak <bdmytrak@gmail.com>)
Responses Re: ERROR: query has no destination for result data  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
So this means it's unable to return data?


2012/11/23 Bartosz Dmytrak <bdmytrak@gmail.com>
Hi,
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@gmail.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



pgsql-general by date:

Previous
From: Peter Kroon
Date:
Subject: Re: ERROR: query has no destination for result data
Next
From: Craig Ringer
Date:
Subject: Re: ERROR: query has no destination for result data