Re: Function return type does not match - Mailing list pgsql-novice

From Gaetano Mendola
Subject Re: Function return type does not match
Date
Msg-id 3F732BE2.7030903@bigfoot.com
Whole thread Raw
In response to Function return type does not match  (Juan Francisco Diaz <j-diaz@publicar.com>)
List 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 by date:

Previous
From: "Derrick Betts"
Date:
Subject: Fw: Difficult select statement
Next
From: Heath Tanner
Date:
Subject: Re: Function return type does not match