On Thu, 19 Jul 2018, Peter H. Lemieux wrote:
From gretl, if I run
? open dsn=polls user=phl --odbc
Connected to ODBC data source 'polls'
? data dem rep query="select democrat,republican from generic" --odbc
? print dem
The symbol 'dem' is undefined
However, if I precede the data command with "smpl 1 228", gretl imports all
228 rows. Is there a way to import data from SQL that doesn't require
knowing the number of observations in advance? I'd like just to point gretl
at a database, give it a query like the above, and have it populate the
database with all the records it finds? Is that not possible? It works like
that when importing data from CSV files.
Thanks!
Peter
Hm, I don't think this is possible at present. The problem is that there
is no way of guessing how many rows the table returned by a SQL query
will have until you execute the query itself.
Would it be possible for to initialise your dataset with a large number
of observations (say, like, "nulldata 100000") and then drop the empty
ones?
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------