Function returning record

Поиск
Список
Период
Сортировка
От alla@sergey.com (Alla)
Тема Function returning record
Дата
Msg-id 9275d56e.0106071053.2f5d8d8f@posting.google.com
обсуждение исходный текст
Ответы Re: Function returning record  ("Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>)
Список pgsql-general
Is it possible in PostgreSQL to write a function that would return a
record type.

What I need is something like this:

create function my_func(varchar)
return record as '
declare
   my_rec   record;
begin
   select null as field1, null as field2
   into my_rec;

   .... some processing to populate the actual values of the record

   return my_rec;
end;
' LANGUAGE 'plpgsql';


I get the following when I try to compile this:
NOTICE:  ProcedureCreate: return type 'record' is only a shell

and following when I try to execute it (even though I am not sure how
to execute this at all);
ERROR:  fmgr_info: function 0: cache lookup failed

Please help.

Thanks a lot in advance

Alla

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

Предыдущее
От: Nicolas Huillard
Дата:
Сообщение: RE: Exploring sequences (sequence context within a transaction)
Следующее
От: "John Moo"
Дата:
Сообщение: Re: [newbie] Relations...