Re: Help making a plpgsql function?

Поиск
Список
Период
Сортировка
От John DeSoi
Тема Re: Help making a plpgsql function?
Дата
Msg-id F45625B7-43DD-426B-B500-A3FDE866367D@pgedit.com
обсуждение исходный текст
Ответ на Re: Help making a plpgsql function?  (Bjørn T Johansen <btj@havleik.no>)
Список pgsql-general
On Jul 5, 2006, at 5:41 PM, Bjørn T Johansen wrote:

> btw, just one more thing...
>
> If I join two or more tables, which type should I use for the
> "into" variable (select into t2 *...) where
> t2 would contain fields from more than one table?
>
> I guess using "t2 some_table%rowtype" won't work when joining tables?


I think you can declare t2 as type record (e.g. "t2 record;" in the
declaration). Alternately, you can declare whatever variables you
need to get from the join and select into them explicitly. Something
like:

select into v1, v2, v3 col1, col2, col3 from t1 join t2 ....



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


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

Предыдущее
От: Chander Ganesan
Дата:
Сообщение: Re: High-Availability Question
Следующее
От: "Jim Cser"
Дата:
Сообщение: Granting COPY TO access