Re: how to return results from code block

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Andrus <kobruleht2(at)hot(dot)ee>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to return results from code block
Date: 2012-06-30 14:23:55
Message-ID: 4FEF0BFB.6050101@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/30/2012 03:17 AM, Andrus wrote:
> 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.

Oops that should have been:

raise notice 'The results are %,%', rec.res1,rec.res2

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Edson Richter 2012-06-30 14:25:19 Complex database infrastructure - how to?
Previous Message Adrian Klaver 2012-06-30 14:18:59 Re: how to return results from code block