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


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to