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

From Bartosz Dmytrak
Subject Re: ERROR: query has no destination for result data
Date
Msg-id CAD8_UcYkm7CR71_J7WpjS48tnQTuBCPNxB=N97GxJWW35w3K9Q@mail.gmail.com
Whole thread Raw
In response to ERROR: query has no destination for result data  (Peter Kroon <plakroon@gmail.com>)
Responses Re: ERROR: query has no destination for result data  (Peter Kroon <plakroon@gmail.com>)
List pgsql-general
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: ERROR: query has no destination for result data
Next
From: Craig Ringer
Date:
Subject: Re: w7 vs linux