Обсуждение: Newbie help please....

Поиск
Список
Период
Сортировка

Newbie help please....

От
"Sue Walker-Thornton"
Дата:
Hi,
     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.  :-)
Thanks,
Sue
 
       NASA Langley Research Center
           ConITS Contract
           Hampton, VA  23666
    (757) 224-4074
     (757) 224-4001
     (757) 218-8263
        (757) 988-2547
 
 
Вложения

Re: Newbie help please....

От
Richard Broersma Jr
Дата:
>      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.

Re: Newbie help please....

От
"Harald Armin Massa"
Дата:
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, which has the query included.

Hope that helps,

best wishes,

Harald

--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 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.