pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedgetting list of columns from a query
6+ messages / 5 participants
[nested] [flat]
* getting list of columns from a query
@ 2010-08-22 17:27 c k <shreeseva.learning@gmail.com>
0 siblings, 3 replies; 6+ messages in thread
From: c k @ 2010-08-22 17:27 UTC (permalink / raw)
To: pgsql-general@postgresql.org; pgsql-admin
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.
CPK
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: getting list of columns from a query
@ 2010-08-22 20:18 Octavio Alvarez <alvarezp@alvarezp.ods.org>
parent: c k <shreeseva.learning@gmail.com>
2 siblings, 0 replies; 6+ messages in thread
From: Octavio Alvarez @ 2010-08-22 20:18 UTC (permalink / raw)
To: pgsql-general@postgresql.org, "c k" <shreeseva.learning@gmail.com>
On Sun, 22 Aug 2010 10:27:52 -0700, c k <shreeseva.learning@gmail.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.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: getting list of columns from a query
@ 2010-08-22 21:18 Daniel J. Summers <daniel.lists@djs-consulting.com>
parent: c k <shreeseva.learning@gmail.com>
2 siblings, 0 replies; 6+ messages in thread
From: Daniel J. Summers @ 2010-08-22 21:18 UTC (permalink / raw)
To: pgsql-admin
On 08/22/2010 05:27 PM, c k wrote:
> 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.
What language are you using, and what technique in that language are you
using? (ex. Java and JDBC, C# and ADO.NET, PHP and PDO, or PHP and
PostgreSQL native) Most of these provide a way to get to the column
names, but they're language- and technique-dependent.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [GENERAL] getting list of columns from a query
@ 2010-08-22 23:26 Pavel Stehule <pavel.stehule@gmail.com>
parent: c k <shreeseva.learning@gmail.com>
2 siblings, 1 reply; 6+ messages in thread
From: Pavel Stehule @ 2010-08-22 23:26 UTC (permalink / raw)
To: c k <shreeseva.learning@gmail.com>; +Cc: pgsql-general@postgresql.org; pgsql-admin
Hello
2010/8/22 c k <shreeseva.learning@gmail.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
>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [GENERAL] getting list of columns from a query
@ 2010-08-23 08:02 c k <shreeseva.learning@gmail.com>
parent: Pavel Stehule <pavel.stehule@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: c k @ 2010-08-23 08:02 UTC (permalink / raw)
To: Pavel Stehule <pavel.stehule@gmail.com>; +Cc: pgsql-general@postgresql.org; pgsql-admin
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.stehule@gmail.com>wrote:
> Hello
>
> 2010/8/22 c k <shreeseva.learning@gmail.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
> >
>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [GENERAL] getting list of columns from a query
@ 2010-08-23 08:23 Scott Marlowe <scott.marlowe@gmail.com>
parent: c k <shreeseva.learning@gmail.com>
0 siblings, 0 replies; 6+ messages in thread
From: Scott Marlowe @ 2010-08-23 08:23 UTC (permalink / raw)
To: c k <shreeseva.learning@gmail.com>; +Cc: Pavel Stehule <pavel.stehule@gmail.com>; pgsql-general@postgresql.org; pgsql-admin
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.learning@gmail.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.stehule@gmail.com>
> wrote:
>>
>> Hello
>>
>> 2010/8/22 c k <shreeseva.learning@gmail.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.
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2010-08-23 08:23 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-08-22 17:27 getting list of columns from a query c k <shreeseva.learning@gmail.com>
2010-08-22 20:18 ` Octavio Alvarez <alvarezp@alvarezp.ods.org>
2010-08-22 21:18 ` Daniel J. Summers <daniel.lists@djs-consulting.com>
2010-08-22 23:26 ` Pavel Stehule <pavel.stehule@gmail.com>
2010-08-23 08:02 ` c k <shreeseva.learning@gmail.com>
2010-08-23 08:23 ` Scott Marlowe <scott.marlowe@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox