[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SQLITE with Octave

From: Przemek Klosowski
Subject: Re: SQLITE with Octave
Date: Wed, 10 May 2017 16:44:40 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0

On 05/10/2017 04:02 PM, Andreas Weber wrote:
Am 10.05.2017 um 17:50 schrieb FMourad:
I have browsed all the topics related to the use of sqlite on octave without
finding a clear solution to my situlation. 
According to the following octave wiki : , two github repositories can be
exploited as sqlite wrappers on octave, but my attemps to use these projects
were unsuccessful. 
These are the links to the repositories : 
The second repo linked is mine and is in an very early stage and not
useful at the moment. Perhaps I should add a big fat warning about that.

The main reason that I stopped development was that markuman pointed me
to the mex wrapper (your first linked repo) and I thought reinventing
the weel would be a bad idea.
I see--and I realized that the problem with the MEX-sqlite3 was very superficial.
The provided Makefile does not link all source files---it leaves out structlist.c.
The following builds an extension that works with my Octave  4.0.3 on Linux:
mkoctfile --mex -lsqlite3 -o sqlite3.mex sqlite3.c structlist.c

it not only passes its tests but also works with my small database.

One conceptual problem I have is that it returns the data as an array of structs (one per row); e.g. for my simple temperature data,

ans = 2016-04-08 17:30
ans = 2016-04-08 17:45
ans = 2016-04-08 18:00
ans = 2016-04-08 18:15
ans = 2016-04-08 18:30
ans = 35
ans = 35
ans = 36
ans = 36
ans = 36

What's the easiest way to return the entire column of data, i.e. collate a given struct field from every array member into a vector?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]