Re: [GENERAL] getting list of columns from a query

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: c k <shreeseva(dot)learning(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org
Subject: Re: [GENERAL] getting list of columns from a query
Date: 2010-08-23 08:23:12
Message-ID: AANLkTimfM2qC5p4hjX1zGsDqAvtdCwiwgiAw8w3tc0UA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

Isn't this provided in odbc by myQuery.columns? Is that not
accessible to MSAccess??

On Mon, Aug 23, 2010 at 2:02 AM, c k <shreeseva(dot)learning(at)gmail(dot)com> wrote:
> I am using PostgreSQL 8.4 on Fedora Linux 13 and using MS Access as the
> front end for our application. It is not the problem associated with MS
> Access. I got the some entries while searching for the said topic that
> Oracle provides such facility.
> DESCRIBE SELECT LIST which gives the details about the column names and data
> types. I need such thing in postgresql, because users of my application can
> execute custom query and then select the aggregate function to be applied to
> the selected columns. This can be done using Pivot Table/Chart in MS Access,
> but it is not sufficient, rather it will be better if postgres has support
> for this.
>
> Thanks and regards to all,
>
> CPK
>
> On Mon, Aug 23, 2010 at 4:56 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
>>
>> Hello
>>
>> 2010/8/22 c k <shreeseva(dot)learning(at)gmail(dot)com>:
>> > 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.
>> >
>>
>> Yes, it is possible, you can get a description of prepared statement's
>> result. See: PQprepare, PQdescribePrepared, PQdescribePortal. These
>> functions are in client postgresql library -
>>
>> http://www.postgresql.org/docs/8.4/interactive/libpq-exec.html#LIBPQ-EXEC-MAIN
>>
>> Regards
>>
>> Pavel Stehule
>>
>> > CPK
>> >
>
>

--
To understand recursion, one must first understand recursion.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Kieren Scott 2010-08-23 14:38:14 pgBouncer for connection pooling
Previous Message c k 2010-08-23 08:02:00 Re: [GENERAL] getting list of columns from a query

Browse pgsql-general by date

  From Date Subject
Next Message SUNDAY A. OLUTAYO 2010-08-23 10:04:48 Sequence reset
Previous Message c k 2010-08-23 08:02:00 Re: [GENERAL] getting list of columns from a query