Re: PL/PgSQL - returning multiple columns ...
От
PFC
Тема
Re: PL/PgSQL - returning multiple columns ...
Дата
Msg-id
opslmvnew2th1vuj@musicbox
Ответ на
Re: PL/PgSQL - returning multiple columns ... (Marc G. Fournier)
Список
Дерево обсуждения
PL/PgSQL - returning multiple columns ... "Marc G. Fournier" <scrappy@postgresql.org>
On Thu, 3 Feb 2005 12:48:11 -0400 (AST), Marc G. Fournier wrote: > > Perfect, worked like a charm ... but the RETURNS still needs to be a > SETOF, other then that, I'm 'away to the races' ... thanks :) No SETOF necessary : CREATE TYPE mytype AS ( number INTEGER, blah TEXT ); CREATE OR REPLACE FUNCTION myfunc( INTEGER ) RETURNS mytype LANGUAGE plpgsql AS $$ DECLARE _retval mytype; BEGIN _retval.number=$1; _retval.blah='yeah'; RETURN _retval; END;$$; SELECT myfunc(22); myfunc ----------- (22,yeah) (1 ligne) SELECT * FROM myfunc(22); number | blah --------+------ 22 | yeah (1 ligne)
В списке pgsql-sql по дате отправления
От: Richard Huxton
Дата:
От: Tom Lane
Дата: