how to return results from code block

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: <pgsql-general(at)postgresql(dot)org>
Subject: how to return results from code block
Date: 2012-06-30 10:17:46
Message-ID: F3F399315EEE46CDA62F7899C2805C8E@dell2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How to return single row or results from code block executed using ADO.NET ExecuteQuery() method.
I tried

DO $$
declare
i integer :=0;

begin
select i+1 as res1, i+2 as res2;
END$$;

but got error:

ERROR: query has no destination for result data

How to return single row result from code pgsql code block ?

Andrus.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2012-06-30 10:26:37 Re: how to return results from code block
Previous Message tuanhoanganh 2012-06-30 09:42:25 Re: Postgresql 9.0.6 alway run VACUUM ANALYZE pg_catalog.pg_attribute