Message: 4
Date: Tue, 20 Apr 2010 09:22:45 +0200 (CEST)
From: "Riccardo (Jack) Lucchetti" <r.lucchetti(a)univpm.it>
Subject: Re: [Gretl-users] Postgresql ODBC connection
To: Gretl list <gretl-users(a)lists.wfu.edu>
Message-ID: <alpine.DEB.2.00.1004200918580.19309(a)ec-4.econ.univpm.it>
Content-Type: text/plain; charset="iso-8859-15"
On Mon, 19 Apr 2010, Stefan Rehm wrote:
> Hi,
> i want to extract data from an existing PostgreSQL database on
> localhost. I tested the ODBC connection with OpenOffice and it works
> nice after entering the database user and password.
> But i'm still confused to extract the data with Gretl. I connected via
> the gretl console to the database named eix with
>
> open dsn=eix user=databaseuser password=password --odbc
>
> and there are no output from the gretl console. how can i access the
> data?
You're halfway through. The "open" command establishes the connection.
The actual data retrieval is a job for the "data" command, which stores
the output of an SQL query. Example:
<script>
qry = "select foo from bar"
data myseries query=qry --odbc
</script>
Hmm, no chance. There is no message after the open command. So i'm not
shure if everything work fine. To retrieve the data i use this workflow:
open dsn='Postgresql eix' user=postgres password=xxx --odbc
[no message in gretl console, then i tried:]
data x query="SELECT id FROM person" --odbc
Can somebody help me out?
Best Regards
Stefan