Re: Function return type does not match

Поиск
Список
Период
Сортировка
От Gaetano Mendola
Тема Re: Function return type does not match
Дата
Msg-id 3F732BE2.7030903@bigfoot.com
обсуждение исходный текст
Ответ на Function return type does not match  (Juan Francisco Diaz <j-diaz@publicar.com>)
Список pgsql-novice
Juan Francisco Diaz wrote:

> Hi I modified my function to:
>
> CREATE FUNCTION buscablista (character varying, character varying) RETURNS
> SETOF cabezalista
>     AS '
>
> select * from cabezalista where idlista like CAST($1 AS CHAR(20)) and
> idlibro like CAST($2 AS CHAR(6));
>
> ' LANGUAGE sql;
>
> But when called it gives me the error:
>
> ERROR:  Query-specified return tuple and actual function return tuple do not
> match
> ERROR:  Query-specified return tuple and actual function return tuple do not
> match

I guess that you are calling the function like is a function:

select buscablista('foo', 'bar');

the function is a Table Function so :

select * from buscablista('foo', 'bar');


Regards
Gaetano Mendola




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

Предыдущее
От: "Derrick Betts"
Дата:
Сообщение: Fw: Difficult select statement
Следующее
От: Heath Tanner
Дата:
Сообщение: Re: Function return type does not match