Re: Newbie help please....

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Sue Walker-Thornton <s(dot)m(dot)thornton(at)larc(dot)nasa(dot)gov>, pgsql-general(at)postgresql(dot)org
Subject: Re: Newbie help please....
Date: 2006-07-17 18:05:56
Message-ID: 20060717180556.45491.qmail@web31811.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> I am relatively new to PostgreSQL, having only been exposed to it with
> a recent DSpace implementation (in the last 8 months or so). I have created
> a new database in PostgreSQL and have written a SQL query against the
> database. The database resides on a Sunfire V440 Solaris 9 machine. I need
> to figure out how to either create an icon on a User's desktop on a Windows
> machine that invokes and runs the SQL query, or - if that can't be done -
> create a script they can execute to accomplish the same thing. The script
> will need to allow the Users to input some parameters which will be passed
> to the SQL query (Begin Date, End Date, etc) and will then execute the query
> write the output to a file and then invoke a Excel spreadsheet macro to
> pull the data into the Excel spreadsheet and format it.
>
> Is this possible or am I on the wrong track?? Any suggestions or help
> would certainly be appreciated. If there's a better way to accomplish this,
> I'd love to hear it. :-)

Why not run the entire query directly from excel directly. All you will need to do is install the
postgresql ODBC driver on each windows machine. Then in excel you can put your query that will be
passed to the server using ODBC. The results will be populated in the excel spreadsheet.

http://pgfoundry.org/projects/psqlodbc/

this was the first result from googling excel and odbc, but it illustrates to procedure well.
http://www.datamystic.com/datapipe/excel_odbc.html

Regards,

Richard Broersma Jr.
>From pgsql-general-owner(at)postgresql(dot)org Mon Jul 17 15:09:36 2006
X-Original-To: pgsql-general-postgresql(dot)org(at)postgresql(dot)org
Received: from localhost (wm.hub.org [200.46.204.128])
by postgresql.org (Postfix) with ESMTP id 1AFD29FA4E3
for <pgsql-general-postgresql(dot)org(at)postgresql(dot)org>; Mon, 17 Jul 2006 15:09:36 -0300 (ADT)
Received: from postgresql.org ([200.46.204.71])
by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024)
with ESMTP id 95481-09 for <pgsql-general-postgresql(dot)org(at)postgresql(dot)org>;
Mon, 17 Jul 2006 18:09:31 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-
Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176])
by postgresql.org (Postfix) with ESMTP id 39EE29FA418
for <pgsql-general(at)postgresql(dot)org>; Mon, 17 Jul 2006 15:09:31 -0300 (ADT)
Received: by py-out-1112.google.com with SMTP id b36so1497934pyb
for <pgsql-general(at)postgresql(dot)org>; Mon, 17 Jul 2006 11:09:30 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=beta; d=gmail.com;
h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references;
b=R4qQJJW1KlfPOs7xzNo+d+BXWlz40WZg7OdfuUjdOMFoFyR0VnritCyjHelrUaudNtlVakIY0ccyEE9TNWy16j9EvmXdmwQdzNOkhRRLtsTpo5+y3F5SbjhocjRQ9rQ1jaVeoCew0NjCls6WJezep+1ingLhka9VLP5s/WO5VV0=
Received: by 10.35.37.18 with SMTP id p18mr4355603pyj;
Mon, 17 Jul 2006 11:09:30 -0700 (PDT)
Received: by 10.35.123.13 with HTTP; Mon, 17 Jul 2006 11:09:30 -0700 (PDT)
Message-ID: <7be3f35d0607171109n327e76e7mf259a37fb38d7749(at)mail(dot)gmail(dot)com>
Date: Mon, 17 Jul 2006 20:09:30 +0200
From: "Harald Armin Massa" <haraldarminmassa(at)gmail(dot)com>
To: "Sue Walker-Thornton" <s(dot)m(dot)thornton(at)larc(dot)nasa(dot)gov>
Subject: Re: Newbie help please....
Cc: pgsql-general(at)postgresql(dot)org
In-Reply-To: <44BBC050(dot)00000C(dot)03608(at)CTS1-109>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_10229_15928748.1153159770050"
References: <44BBC050(dot)00000C(dot)03608(at)CTS1-109>
X-Virus-Scanned: Maia Mailguard 1.0.1
X-Archive-Number: 200607/650
X-Sequence-Number: 98274

------=_Part_10229_15928748.1153159770050
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Sue,

you can walk an easier road to get your Excel Table filled with PostgreSQL
data:

there is an ODBC.Driver for PostgreSQL, you can google it or find it within
the standard PostgreSQL for Windows Installer.

After installing the ODBC driver, PostgreSQL is a normal data soure to
Excel; you can put your Query into MSQuery (or whatever that tool is called
in your Office Version) and have your data directly within Excel.

So your Icon on the desktop can be a simple link to an Excel template, whic=
h
has the query included.

Hope that helps,

best wishes,

Harald

--=20
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstra=DFe 202b
70197 Stuttgart
0173/9409607
-
on different matter:
EuroPython 2006 is over. It was a GREAT conference. If you missed it, now
you can prepare budget for visiting EuroPython 2007.

------=_Part_10229_15928748.1153159770050
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Sue,<br><br>you can walk an easier road to get your Excel Table filled with=
PostgreSQL data:<br><br>there is an ODBC.Driver for PostgreSQL, you can go=
ogle it or find it within the standard PostgreSQL for Windows Installer.
<br><br>After installing the ODBC driver, PostgreSQL is a normal data soure=
to Excel; you can put your Query into MSQuery (or whatever that tool is ca=
lled in your Office Version) and have your data directly within Excel.<br>
<br>So your Icon on the desktop can be a simple link to an Excel template, =
which has the query included.<br><br>Hope that helps,<br><br>best wishes,<b=
r><br>Harald<br><br>-- <br>GHUM Harald Massa<br>persuadere et programmare
<br>Harald Armin Massa<br>Reinsburgstra=DFe 202b<br>70197 Stuttgart<br>0173=
/9409607<br>-<br>on different matter: <br>EuroPython 2006 is over. It was a=
GREAT conference. If you missed it, now you can prepare budget for visitin=
g EuroPython 2007.

------=_Part_10229_15928748.1153159770050--

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matteo Bertini 2006-07-17 19:06:05 SELECT * WHERE id IN (list of ids)
Previous Message Sue Walker-Thornton 2006-07-17 16:52:32 Newbie help please....