Re: getting list of columns from a query

From: "Octavio Alvarez" <alvarezp(at)alvarezp(dot)ods(dot)org>
To: pgsql-general(at)postgresql(dot)org, "c k" <shreeseva(dot)learning(at)gmail(dot)com>
Subject: Re: getting list of columns from a query
Date: 2010-08-22 20:18:00
Message-ID: op.vhuvz6hd4oyyg1@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

On Sun, 22 Aug 2010 10:27:52 -0700, c k <shreeseva(dot)learning(at)gmail(dot)com>
wrote:

> Hi all,
> As I am using MS Access for a long time, many tools like ms access
> provides
> a way to get the list of columns from a query. (using filed list in combo
> boxes in ms access). But is it possible to get such list of columns from
> a
> query where it is not known to the user, that which columns are defined
> in
> the base 'SELECT' statement? How? I dynamically created SQL statements
> many
> times this situation occurs where the columns are not fixed and we have
> to
> get the list of columns from such a query.
> Thanks in advance.

I am removing psql-admin from the Cc to avoid crossposting. Besides, I
am not sure if it is on-topic there or not.

Which version of PostgreSQL? Anyway, if you create the SELECT statement
dynamically you could know a priori what columns would result, AFAIU.

--
Octavio.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Daniel J. Summers 2010-08-22 21:18:47 Re: getting list of columns from a query
Previous Message c k 2010-08-22 17:27:52 getting list of columns from a query

Browse pgsql-general by date

  From Date Subject
Next Message Daniel J. Summers 2010-08-22 21:18:47 Re: getting list of columns from a query
Previous Message c k 2010-08-22 17:27:52 getting list of columns from a query