Re: PL/pgsql return resultset/cursor?
От | Jan Wieck |
---|---|
Тема | Re: PL/pgsql return resultset/cursor? |
Дата | |
Msg-id | 200203231054.g2NAsB217580@saturn.janwieck.net обсуждение исходный текст |
Ответ на | PL/pgsql return resultset/cursor? (Richard Emberson <emberson@phc.net>) |
Ответы |
Re: PL/pgsql return resultset/cursor?
|
Список | pgsql-general |
Richard Emberson wrote: > > Is it possible to return a result-set or cursor from a PL/pgsql > procedure, like > > CREATE OR REPLACE FUNCTION foo() > RETURNS <WHAT_TYPE> AS ' > BEGIN > RETURN SELECT * from FOO; > END; > ' LANGUAGE 'plpgsql'; > > If you open a cursor in a procedure, it gets closed when the procedure > exits, right? Cursors get closed in PostgreSQL when you close them or when the transaction ends. Look at the refcursor data type (new in v7.2) and use transactions. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
В списке pgsql-general по дате отправления: