how to return a result set from a stored procedure

Поиск
Список
Период
Сортировка
От Hugo
Тема how to return a result set from a stored procedure
Дата
Msg-id f3d9ba9905061105349c8afef@mail.gmail.com
обсуждение исходный текст
Ответ на Pb with linked tables on PG8  ("Ets ROLLAND" <ets@rolland-fr.com>)
Ответы Re: how to return a result set from a stored procedure  (Petar Jovanovic <jpetar@pinsoft.com>)
Список pgsql-general
Hi everybody

I am trying to write a stored procedure that returns a result set but it is not working
this is the function:
///
CREATE OR REPLACE FUNCTION remisiones.fn_get_total_remitidoxprovision1("numeric")
RETURNS SETOF record AS
$BODY$
begin
  select rm.provision as provision,
           drm.producto as producto,
           sum(drm.cantidad) as cantidad
 FROM remisiones.remisiones rm, remisiones.detalles_remision drm
 WHERE rm.remision = drm.remision and rm.provision = $1
GROUP BY rm.provision, drm.producto
ORDER BY rm.provision, drm.producto;
end;$BODY$

///
If  I call this function from the interactive sql of pgadminIII I get this result:
   select * from fn_gert_total_remitidosxprovision(1)
---------------------------------------------------------------------------
   row    refcursor
   1       <unnamed porta1>


is there a way to display the value of the rows returned, i need it becouse I need to use it in a Datawindow definition in an Powerbuilder app.

thanks in advance

Hugo


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

Предыдущее
От: "Thomas F. O'Connell"
Дата:
Сообщение: Re: CPU-intensive autovacuuming
Следующее
От: Hugo
Дата:
Сообщение: how to return a result set from a stored procedure