Re: how to return results from code block

From: Pavel Stehule <pavel(dot)stehule(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 10:26:37
Message-ID: CAFj8pRA5ss9zR5ddz4UpeZ9GvkVoXWwarwWPugaM=5Kgku8yyg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

2012/6/30 Andrus <kobruleht2(at)hot(dot)ee>:
> 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 ?

you cannot return any result from block - block is similar to void function

Regards

Pavel

>
> Andrus.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2012-06-30 13:02:23 How to insert record only if primary key does not exist
Previous Message Andrus 2012-06-30 10:17:46 how to return results from code block