Re: select refcursor into a variable

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: select refcursor into a variable
Дата
Msg-id 200212040946.41082.dev@archonet.com
обсуждение исходный текст
Ответ на select refcursor into a variable  ("Madhavi" <madhavi@zoniac.com>)
Список pgsql-general
On Wednesday 04 Dec 2002 6:48 am, Madhavi wrote:
> Hi all,
>    I'm executing dynamic queries in postgres7.2.3. Is there a way I can
> execute a refcursor and then select it into a variable and then return that
> variable? My query returns the sum of values. So its only one single
> value...that I want to select into a variable. How do I do this. 'cos I
> don't wnat to return a refcursor.

Not sure that you need a refcursor at all for what you're describing. Define
the function as returning int4 (or whatever numeric type is desired) and
either SELECT INTO, or use a LOOP on the refcursor if that's what you need.


--
  Richard Huxton

В списке pgsql-general по дате отправления:

Предыдущее
От: suresh s
Дата:
Сообщение: problem starting postgresql i.e postmaster
Следующее
От: pginfo
Дата:
Сообщение: Re: pg and number of parameters by insert