I found the table that I wasn't closing properly, which was locking up my 
database.  Thanks again, Dr. Hipp, for pointing me in the right direction.

But I just stumbled on another problem.  It shouldn't show up in production, 
but it wouldn't be good to ignore it, either.  

The table I'm working with has 3 columns:  a tag_key, a value and a time.  The 
tag_key is a foreign key into another table that has 5 record, so the possible 
values of tag_key are 1, 2, 3, 4 and 5.  Data is added to this table in sets, 
one record for each possible tag key.  At our customer's site, this table is 
about 68 megabytes long, containing data from several months ago up to the 
current time.  For convenience in debugging, yesterday morning I stripped out 
all data except that recorded between midnight and the current time, so now it 
contains only about nine hours' worth of data.

The control I developed that displays the graph allows the user to select data 
up to one month old.  So, just for the heck of it, I asked for data about two 
weeks old.  This generated the following query:

select tag_key, value, julianday(value_timestamp) AS juliantime from trend_data 
where tag_key in (select tag_key from trend_pens where trend_key = 1) and 
datetime(value_timestamp, 'localtime') > '2009-02-25 17:26:42' and 
datetime(value_timestamp, 'localtime') < '2009-03-25 13:26:42'

There is no data in the trend_data table that is older than 2009-03-25 
13:26:42, so this query should just return no records.  Instead, sqlite3 throws 
an out of memory error!  

I know this isn't very much to go on, but can anyone suggest anything I might 
be doing wrong that would cause this simple query to fail so badly?

My control is written in C++ using MS Visual Studio 6.

Thank you very much!

RobR



      
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to