Problem with return type of function ??? (corrected)

Поиск
Список
Период
Сортировка
От Denis BUCHER
Тема Problem with return type of function ??? (corrected)
Дата
Msg-id 4AE046E4.8010205@hsolutions.ch
обсуждение исходный текст
Ответы Re: Problem with return type of function ??? (corrected)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Hello, (CORRECTED VERSION OF MY PREVIOUS EMAIL)

I have a strange problem, because it worked in a fonction for a table,
and now I created the same (?) function for another table and it doesn't
work...

The function is accepted but at runtime I get :

ERREUR:  wrong record type supplied in RETURN NEXT
CONTEXTE : PL/pgSQL function "find_sn_live" line 26 at return next

Does someone maybe knows what it could be ?

This is (a part of) my function :

> CREATE OR REPLACE FUNCTION rma.find_sn_live (varchar(30)) RETURNS SETOF rma.serial_number
>     AS $_$
> DECLARE
>    serialnumber ALIAS FOR $1;
>    row RECORD;
> BEGIN
> 
> FOR row IN
> SELECT * FROM rma.serial_number WHERE sn=serialnumber
> LOOP
> RETURN NEXT row;
> END LOOP;
> 
> END;
> $_$
>     LANGUAGE plpgsql STRICT;


Thanks a lot for any help !

Denis


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



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

Предыдущее
От: Denis BUCHER
Дата:
Сообщение: Re: Problem with return type of function ???
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Problem with return type of function ???