Re: plpgsql functions
От | Raymond O'Donnell |
---|---|
Тема | Re: plpgsql functions |
Дата | |
Msg-id | 48A5EB74.8030804@iol.ie обсуждение исходный текст |
Ответ на | plpgsql functions ("c k" <shreeseva.learning@gmail.com>) |
Ответы |
Re: plpgsql functions
|
Список | pgsql-general |
On 15/08/2008 20:12, c k wrote: > Hi, > I am getting an error for a function written in plpgsql, as - > > CREATE OR REPLACE FUNCTION uf_accgroupbal(date, date, p_company integer) > RETURNS SETOF uf_closingbal AS <snip> For functions return SETOF any type, you need to use the following idiom: ... declare rec yourtype; begin for rec in [your query here...] loop return next rec; end loop; return; end; ... See the docs on control structures in pl/pgsql. Ray. ------------------------------------------------------------------ Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland rod@iol.ie Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals ------------------------------------------------------------------
В списке pgsql-general по дате отправления: