Re: returning composite types.

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: returning composite types.
Дата
Msg-id 3E85CE8B.3010700@joeconway.com
обсуждение исходный текст
Ответ на Re: returning composite types.  (Franco Bruno Borghesi <franco@akyasociados.com.ar>)
Ответы Re: returning composite types.  (Franco Bruno Borghesi <franco@akyasociados.com.ar>)
Список pgsql-sql
Franco Bruno Borghesi wrote:
> ok, soy you're telling me that the only way to return a composite type is 
> using a set of them, even if I know my function will allways return 1 record.

Try this:

create type foo as (f1 int, f2 text);
create or replace function retfoo(int, text) returns foo as ' declare  result foo%ROWTYPE; begin  select into result
$1,$2;  return result; end;
 
' language 'plpgsql';

regression=# select * from retfoo(2,'b'); f1 | f2
----+----  2 | b
(1 row)

Joe



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

Предыдущее
От: Franco Bruno Borghesi
Дата:
Сообщение: Re: returning composite types.
Следующее
От: Franco Bruno Borghesi
Дата:
Сообщение: Re: returning composite types.