Re: Function to return a multiple colmn table or view

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Function to return a multiple colmn table or view
Дата
Msg-id 462E27D4.5020307@archonet.com
обсуждение исходный текст
Ответ на Function to return a multiple colmn table or view  ("Wilkinson, Jim" <Jim.Wilkinson@cra-arc.gc.ca>)
Список pgsql-sql
Don't forget to cc: the list

Wilkinson, Jim wrote:
> Hi Richard, your example worked find , but when I substitue my view into
> the function and the tale name, I get the following error:
> 
> ERROR: wrong record type supplied in RETURN NEXT
> CONTEXT: Pl/pqSQL function "create_view" line 11 at return next

The columns you're returning from the function don't match it's definition.

If the function is defined as RETURNS SETOF X then it needs to return 
columns that match X. If you need to you can create a custom type (see 
"CREATE TYPE" in the manuals).

If you want one function that returns different types then you can't 
have it.

--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: Ragnar
Дата:
Сообщение: Re: hi
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: hi