Am 21.03.20 um 17:07 schrieb Allin Cottrell:
On Fri, 20 Mar 2020, Artur Tarassow wrote:
> I had again a look at this issue. So the connection is there and the
> correct data gets fetched. However, the resulting series "klima" has
> only zeros. The error message is "Error executing script: halting".
> The terminal output is:
>
> <Terminal>
> SQL query: 'SELECT KLIMA FROM OV_AS_LAB_LUMEN.IFO_DATA LIMIT 5'
> Number of columns = 1
> col 1 (KLIMA): data_type SQL_DECIMAL, size 4, digits 1, nullable 2
> Number of Rows (from SQLRowCount) = 5
> Fetch, row 0: col 0: data value 102.2
> Fetch, row 1: col 0: data value 102.5
> Fetch, row 2: col 0: data value 99.7
> Fetch, row 3: col 0: data value 102.6
> Fetch, row 4: col 0: data value 101.5
> SQLFreeHandle(SQL_HANDLE_STMT): SQL_SUCCESS
> SQLDisconnect: SQL_SUCCESS
> SQLFreeHandle(SQL_HANDLE_DBC): SQL_SUCCESS
> SQLFreeHandle(SQL_HANDLE_ENV): SQL_SUCCESS
> </Terminal>
>
> I know that it worked before latest feature implementing fetching
> string-valued series.
I'm not able to replicate the proble (yet).
To make debugging of ODBC a bit easier I've added an ODBC-specific
--verbose option to the "data" command. Use that option and you'll get
debugging spew in the regular gretl output (not stderr any more). I've
also added a little more detail.
I'm attaching a little tar.gz file with kit to try out my attempted
replication of the problem. (For me the example works OK.) There's a
README in the package, but here's the gist: create a tiny database that
mimics the data Artur showed, then read from it using gretl.
Thanks for your effort, Allin. I think I have it now. The issue is that
I have initialized a dataset (via the nulldata command) of length 10 but
the returned series has only length 5. When bot the length of the
existing data set and the fetched one coincide, all works well.
I am pretty sure that up to a month ago or so, it worked well in case
the length of the existing data set was larger than that of the newly
fetched one. Usually I don't know exactly how long the returned series
will be. So I initialize a large data set, fetch data and restrict the
data set to valid observations only. _This_ does not seem to work any
more and causes trouble.
To summarize:
1) In case no data set is open, <data ...--odbc> returns just "Error
executing script" -- not very informative I guess ;-)
2) In case the length of the current data set is longer than the fetched
one, all values of newly attached data are zero as explained before.
3) In case the length of the current data set is smaller than of the
fetched one, the error message "Error executing script" occurs.
Hope that helps,
Artur