| От | Stephan Szabo |
|---|---|
| Тема | Re: set-returning function in pg 7.4.6 |
| Дата | |
| Msg-id | 20050314075335.K8517@megazone.bigpanda.com обсуждение исходный текст |
| Ответ на | set-returning function in pg 7.4.6 (Raphael Bauduin <raphael.bauduin@be.easynet.net>) |
| Список | pgsql-novice |
On Mon, 14 Mar 2005, Raphael Bauduin wrote: > Here's the function: > > create or replace function GetRows() returns setof int as > ' > declare > r record; > begin > for r in EXECUTE ''select customer_id from customers'' loop > return next r.customer_id; > end loop; > return; > end > ' > language 'plpgsql'; > > > When I call this function as > > select GetRows(); > > I get this error: > > ERROR: set-valued function called in context that cannot accept a set > CONTEXT: PL/pgSQL function "getrows" line 5 at return next You need to call it with the function in the from clause select * from GetRows();
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера