Re: return rows question
От | Joe Conway |
---|---|
Тема | Re: return rows question |
Дата | |
Msg-id | 3D0AA479.6030505@joeconway.com обсуждение исходный текст |
Ответ на | Re: return rows question (Laurette Cisneros <laurette@nextbus.com>) |
Ответы |
Re: return rows question
|
Список | pgsql-interfaces |
Laurette Cisneros wrote: > Thanks. I had looked into this. But, it's not quite what I was looking > for. > > I am writing a set of functions to act as an api to access data in the > database. There are times when I would need to return a set of rows or > even a set of text from a pl/pgsql function based on some logic (no such > thing as logic in SQL). > > Any ideas? > > Thanks for the help, > > L. Sorry, but even in current development sources, PL/pgSQL cannot return a set (or at least if it can, I can't figure out how). I'm hoping to change that before 7.3 is released, but at this point I haven't even looked at it too hard. You might look at having your function return a refcursor. See: http://developer.postgresql.org/docs/postgres/plpgsql-cursors.html section 23.7.3.3. Returning Cursors. The URL is for the 7.3 development docs, but I think the example shown will work in 7.2.x. Joe
В списке pgsql-interfaces по дате отправления: