Re: Function returning SETOF returns nothing

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Function returning SETOF returns nothing
Дата
Msg-id 18710.1333590230@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Function returning SETOF returns nothing  (Coby Beck <coby101@gmail.com>)
Ответы Re: Function returning SETOF returns nothing  (Coby Beck <coby101@gmail.com>)
Список pgsql-novice
Coby Beck <coby101@gmail.com> writes:
> Thanks for the advice, Tom...I am still having trouble as many
> variations tried all give compile errors.

More modern versions give a more useful error message:

ERROR:  RETURN NEXT must specify a record or row variable in function returning row
LINE 4:     RETURN NEXT (SELECT ''old'' as type, ''item'' as item, '...
                        ^

So what you need to do is declare a variable of type ForecastData,
assign into the fields of that variable, and then "RETURN NEXT varname".

            regards, tom lane

В списке pgsql-novice по дате отправления:

Предыдущее
От: Coby Beck
Дата:
Сообщение: Re: Function returning SETOF returns nothing
Следующее
От: Coby Beck
Дата:
Сообщение: Re: Function returning SETOF returns nothing