Search Postgresql Archives

Re: Help making a plpgsql function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux