PLpgSQL FOR IN EXECUTE question

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: PLpgSQL FOR IN EXECUTE question
Date: 2002-11-07 14:35:27
Message-ID: 3DCA7A2E.6DD4CABE@rodos.fzk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Consider the following PLpgSQL code fragment

FOR this_record IN
EXECUTE ''SELECT ''
|| quote_ident($1)
|| ''FROM ''
|| quote_ident($2)
LOOP
list := list || '', '' || this_record.$1 ;
END LOOP;

As expected, accessing a field via this_record.$1
does not work.
Can it be done otherwise?

Regards, Christoph

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2002-11-07 14:35:30 Re: primary keys
Previous Message Huub 2002-11-07 14:29:35 Re: primary keys