| От | Joe Conway |
|---|---|
| Тема | Re: Returning result sets. |
| Дата | |
| Msg-id | 3E4C4CFE.6090503@joeconway.com обсуждение исходный текст |
| Ответ на | Returning result sets. (Michael Weaver <mweaver@corpusglobe.com>) |
| Список | pgsql-sql |
Michael Weaver wrote:
> How do I declare a stored function to return a result set. (ie set of
> records)
>
> I can define a function returning " setof record "
> but I get an error:
>
> A column definition list is required for functions returning RECORD
>
> The docs(7.3) seem to think that this should be ok.
> so what is wrong?
You need to look a bit closer at the docs ;-)
After declaring myfunc() to return setof record, try:
select * from my_func() AS (a int8, b int8, c numeric, d numeric);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing - "the column definition list"
HTH,
Joe
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера