Re: Stored procedures vs Functions
| От | Jeff Davis |
|---|---|
| Тема | Re: Stored procedures vs Functions |
| Дата | |
| Msg-id | 0GOQ007SW1WE5G@mta7.pltn13.pbi.net обсуждение |
| Ответ на | Re: Stored procedures vs Functions (Bruce Momjian <pgman@candle.pha.pa.us>) |
| Ответы |
Re: Stored procedures vs Functions
|
| Список | pgsql-general |
> Some people return results in temp tables, 7.2 will allow cursors to be
> returned.
Oh great! I missed that addition. That should help out a lot.
I was trying it out and I had no problem creating the function. However, if I
have a function that returns a reference to a cursor, how would I got about
fetching form that cursor reference? I guess my question is: with SQL, how do
I turn the cursor reference into an actual cursor from which I may fetch
records? Below is what I tried:
jdavis=# begin;
BEGIN
jdavis=# select f1();
f1
--------------------
<unnamed cursor 5>
(1 row)
jdavis=# fetch 1 from f1();
ERROR: parser: parse error at or near "("
ERROR: parser: parse error at or near "("
jdavis=# fetch 1 from (select f1());
ERROR: parser: parse error at or near "("
ERROR: parser: parse error at or near "("
jdavis=# declare cursor2 cursor f1();
ERROR: parser: parse error at or near "f1"
ERROR: parser: parse error at or near "f1"
jdavis=# declare cursor2 cursor (select f1());
ERROR: parser: parse error at or near "("
ERROR: parser: parse error at or near "("
jdavis=#
Thanks!
Jeff
В списке pgsql-general по дате отправления: