[SQL] plpgsql: return results of a dynamic query

2003-01-29 Thread Moritz Lennert
Hello, I'am a complete newbie to plpgsql, so if this information is explained somewhere where I haven't looked, yet, please point me to the doc... (I didn't find the answer in the PostgreSQL Programmer's Guide.) I use PG 7.3.1. I'm trying to retrieve a row count from several tables (40) and

Re: [SQL] plpgsql: return results of a dynamic query

2003-01-29 Thread Christoph Haller
I'm trying to retrieve a row count from several tables (40) and would like to create a function that does this automatically for the 40 and displays the results. So, I loop through the tables: DECLARE obj RECORD; BEGIN FOR obj IN SELECT relname AS name FROM pg_class

Re: [SQL] plpgsql: return results of a dynamic query

2003-01-29 Thread Moritz Lennert
I'm trying to retrieve a row count from several tables (40) and would like to create a function that does this automatically for the 40 and displays the results. So, I loop through the tables: DECLARE obj RECORD; BEGIN FOR obj IN SELECT relname AS name FROM pg_class