Re: [SQL] joining a table whose name is stored in the primary record

2007-06-19 Thread John Gunther
Andreas Kretschmer wrote: create or replace function zip_foo(OUT out_id int, OUT out_name text, OUT out_name2 text) returns setof record as $$ declare my_rec RECORD; my_name TEXT; begin for my_rec in select id, name, parent_tbl, parent_id from zip LOOP e

Re: [SQL] joining a table whose name is stored in the primary record

2007-06-19 Thread John Gunther
Andrew Sullivan wrote: On Sun, Jun 17, 2007 at 04:39:51AM -0400, John Gunther wrote: functions and using subqueries without success. I think I need someone to point me in the right conceptual direction. Well, the right SQL-esque conceptual direction is not to have

[SQL] joining a table whose name is stored in the primary record

2007-06-17 Thread John Gunther
ight conceptual direction. Thanks. John Gunther Bucks vs Bytes Inc ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through