Function returning RECORD

Поиск
Список
Период
Сортировка
От Cristian Custodio
Тема Function returning RECORD
Дата
Msg-id 004201c2e830$8c8cb0e0$fb01a8c0@ttcristian
обсуждение исходный текст
Список pgsql-general
Hi,

I'm not be able to use a function to return the record type.

AnyBody could help me? Look this exemple:

CREATE OR REPLACE FUNCTION TESTERECORD()
RETURNS record AS '
DECLARE
vRecRetorno Record;
BEGIN
 SELECT teste INTO vRecRetorno FROM (SELECT ''Function record '' AS teste) AS TABELA;
 RETURN vRecRetorno;
END;
' language 'plpgsql';
 
 
 
CREATE OR REPLACE FUNCTION TESTECHAMARECORD()
RETURNS varchar AS '
DECLARE
vrecord RECORD;
v varchar;
BEGIN
 SELECT testerecord() INTO vrecord;
 v := vrecord.teste; -- Here is the error
 RETURN v;
end;
' language 'plpgsql';
 

select testechamarecord();

When I call the testechamarecord function, the following message error appear:

record "vrecord" has no field named "teste"
 

Help-me, please.

Cristian Luciano Custodio

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

Предыдущее
От: Luis Tena
Дата:
Сообщение: TO ADMIN: E-mail change
Следующее
От: Stephen Robert Norris
Дата:
Сообщение: Re: pg_dump strangeness