plpgsql function returning SETOF RECORD Question

Поиск
Список
Период
Сортировка
От
Тема plpgsql function returning SETOF RECORD Question
Дата
Msg-id 20040223132208.MQDR10961.mta07-svc.ntlworld.com@mta7-svc
обсуждение исходный текст
Ответы Re: plpgsql function returning SETOF RECORD Question  (Joe Conway <mail@joeconway.com>)
Список pgsql-sql
Hi

When I run the function below I recieve an error message saying that column definitions need to be specified for a
functionreturing a type RECORD.
 

I was under the impression that the FOR row IN SELECT... loop would assign a column structure to the RECORD type. Am I
wrongabout this?
 

CREATE FUNCTION test() RETURNS SETOF RECORD AS '
DECLARE row  RECORD;
BEGIN FOR row IN SELECT * FROM dates LOOP   RETURN NEXT row; END LOOP;
 RETURN;
END;
' LANGUAGE 'plpgsql';

PostgreSQL 7.3.2-3 on Red Hat 9.

Regards

John Duffy

-----------------------------------------
Email provided by http://www.ntlhome.com/




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

Предыдущее
От: "Sumita Biswas (sbiswas)"
Дата:
Сообщение: Execute Query in Postgres Function
Следующее
От: "Philip J. Boonzaaier"
Дата:
Сообщение: Triggers