Re: Error Returned by A Function

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Error Returned by A Function
Дата
Msg-id 20060110164009.GA62009@winnie.fuhr.org
обсуждение исходный текст
Ответ на Error Returned by A Function  ("Lane Van Ingen" <lvaningen@esncc.com>)
Список pgsql-novice
On Tue, Jan 10, 2006 at 10:42:39AM -0500, Lane Van Ingen wrote:
> select * from current_neighbors(2);
>
> ERROR:  cannot assign non-composite value to a row variable
> CONTEXT:  PL/pgSQL function "current_neighbors" line 15 at assignment

Line 15 of the function is:

>   returnValue := 'none';

You've declared returnValue to be a composite type (typ_remote_net)
so you need to assign to a particular column or use a row constructor:

    returnValue.remote_net := 'none';
    -- or
    returnValue := row('none');

Likewise in a few other places.  Also, the function's query has a
syntax error:

>     order by BY 1,3,2

--
Michael Fuhr

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Error Returned by A Function
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: translating this SQL query from a different dialect