On Sat, 28 Mar 2020, Artur Tarassow wrote:
Hi Allin,
this issue seems fixed. The query yields the correct results now. Thank you!
But let me pose another issue: Suppose one wants to fetch cross-sectional
data from the DB but one has no idea of how many rows the table has. In the
past it was possible to initialize a very large gretl dataset of R rows and
to fetch some table with r<=R rows. Gretl just filled the first r rows with
data fetched, and the remaining R-r rows where all NA and could be dropped in
another step.
I've used the following workaround:
<hansl>
clear
open dsn=MyDSN user=jack password=pwd --odbc
nulldata 1
data tmp query="select count(*) from tablename" --odbc
scalar n = tmp[1]
nulldata n --preserve
q1 = sprintf("select whatever from somedata limit %d", $nobs)
data foobar query=q1 --odbc
</hansl>
-------------------------------------------------------
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
-------------------------------------------------------