Re: [sqlite] sqlite3 - DB gets locked

2009-12-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Vinod Nanjaiah wrote: > a> Is there any way to unlock a DB that has got locked? > b> What are the usual reasons for a DB getting locked? > c> Is there any DB setting that would prevent the DB from getting locked? http://www.sqlite.org/lockingv3.html

[sqlite] sqlite3 - DB gets locked

2009-12-01 Thread Vinod Nanjaiah
Hi, I am using sqlite-3.6.19. I find that the Database that I create gets locked often. There are about 9 processes that access my DB. I have written a wrapper for the sqlite3 library calls in which I am doing the DB open and DB close for every operation (read/write) on the DB. a> Is there any

Re: [sqlite] Slow JOIN on two indexed text fields. Why?????

2009-12-01 Thread sorka
Thank you! That was it. I've been pulling my hair out over this all day. I should have seen it. I've never used STRING in my own tables and I inherited this from someone else and didn't even think twice that the type difference would be the issue. Thanks you again. sorka wrote: > > This

Re: [sqlite] Slow JOIN on two indexed text fields. Why?????

2009-12-01 Thread Igor Tandetnik
Igor Tandetnik wrote: > sorka wrote: >> This is driving me nuts. I have two tables I'm trying to join >> together on two text fields. >> >> CREATE TABLE tmp_role ( programId INTEGER, >> roleNameINTEGER, >> positionINTEGER, >> isNew

Re: [sqlite] Slow JOIN on two indexed text fields. Why?????

2009-12-01 Thread Igor Tandetnik
sorka wrote: > This is driving me nuts. I have two tables I'm trying to join > together on two text fields. > > CREATE TABLE tmp_role ( programId INTEGER, > roleNameINTEGER, > positionINTEGER, > isNew BOOL, > personIdINTEGER, > nameSTRING);

[sqlite] Convert Access sql to SQLite sql

2009-12-01 Thread P.McFarlane
I am currently converting a project that uses Access as a database to using SQLite. Part of this involves rewriting sql queries. So far this has been OK, however I have struck a problem with an UPDATE query. The following access sql query updates some fields in a table depending on existing

[sqlite] Slow JOIN on two indexed text fields. Why?????

2009-12-01 Thread sorka
This is driving me nuts. I have two tables I'm trying to join together on two text fields. CREATE TABLE tmp_role ( programId INTEGER, roleNameINTEGER, positionINTEGER, isNew BOOL, personIdINTEGER, nameSTRING); This table has up to a few dozen records at

Re: [sqlite] Possibly a bug in SQLite?

2009-12-01 Thread Igor Tandetnik
Brandon Wang wrote: > I've come upon a interesting scenerio. > > .sqlite> .schema rg_configuration > CREATE TABLE 'rg_configuration' ( >"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, >"configurationName" TEXT NOT NULL, >"host" TEXT, >"user" TEXT, >

[sqlite] Possibly a bug in SQLite?

2009-12-01 Thread Brandon Wang
Hello, I've come upon a interesting scenerio. .sqlite> .schema rg_configuration CREATE TABLE 'rg_configuration' ( "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "configurationName" TEXT NOT NULL, "host" TEXT, "user" TEXT, "parentArch" INTEGER NOT NULL, "parentJob"

[sqlite] Add better support to 64-bit Windows

2009-12-01 Thread fiacca.m
isNT() 64-bit Windows is NT only sqlite3Hwtime() Inline assembler cannot be used for Visual C++ of the x64 target. Compiler intrinsics __rdtsc() function. ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Broken RSS

2009-12-01 Thread Filip Navara
Hello, the RSS at http://www.sqlite.org/src/timeline.rss is broken. The contents of several elements are not properly escaped (< and > characters), so several readers can't parse it - Google Reader for example. Best regards, Filip Navara ___

Re: [sqlite] Sampling Data

2009-12-01 Thread npearson99
Simon Slavin-3 wrote: > > >> But then I would have to do another statement for the next row like this: >> Avg(watts) from tblData where minute = 5 or minute = 6 or minute = 7 or >> minute = 8. > > Sure. It's called writing software. > Yes, I have this solved via software already. I

Re: [sqlite] Sampling Data

2009-12-01 Thread Oliver Peters
SELECT mingroup, avg(watt) FROM ( SELECT int(minute/5) as mingroup, watt FROM samples ) ; not tested Oliver > -Ursprüngliche Nachricht- > Von: "npearson99" > Gesendet: 01.12.09 21:08:00 > An: sqlite-users@sqlite.org > Betreff: Re: [sqlite] Sampling Data > > >

Re: [sqlite] Sampling Data

2009-12-01 Thread Igor Tandetnik
npearson99 wrote: > The data looks like this for the minute and watts columns > Minute Watt > 1 100 > 2 110 > 3 111 > 4 95 > 5 120 > 6 90 > 7 15 > 8 220 > > It goes on like

Re: [sqlite] Sampling Data

2009-12-01 Thread Simon Slavin
On 1 Dec 2009, at 8:06pm, npearson99 wrote: > So I could go select Avg(watts) from tblData where minute = 1 or minute =2 > or minute =3 or minute = 4 SELECT avg(watts) FROM tblData WHERE minute BETWEEN 1 AND 4 would be far faster, especially if you have an index on minute. > But then I would

Re: [sqlite] Sampling Data

2009-12-01 Thread npearson99
Simon Slavin-3 wrote: > > > SELECT minute,avg(watt) FROM samples GROUP BY minute > > Thanks for the quick response! I could accomplish it that way but I would have to query many many times. My data has about 8000 records. The data looks like this for the minute and watts columns Minute

Re: [sqlite] Sampling Data

2009-12-01 Thread Simon Slavin
On 1 Dec 2009, at 7:29pm, npearson99 wrote: > Example Table: > tableID > Minute > Watt > > I'm trying to sum average the watt column by minute. Use 'avg(X)' on the result of a SELECT which finds all the samples within a particular minute. http://www.sqlite.org/lang_aggfunc.html It is

[sqlite] Sampling Data

2009-12-01 Thread npearson99
I had another question before about moving averages via sql statement and the response I got was great. Now I'm trying to "sample" the data. I guess it would be a form of smoothing but I'm not sure what to call it. I want to do something like this: row1 = (item[0] + item[1] + item[2] +

Re: [sqlite] sqlite3ExprCodeIN() problems with SQLITE_OMIT_SUBQUERY

2009-12-01 Thread D. Richard Hipp
On Dec 1, 2009, at 12:17 PM, Ralf Junker wrote: > > always made me believe that all options to omit features are > supported. > Now I am not sure which ones I can really trust. > > Could you clear up my confusion? > There are several dozen individual compile-time options. We obviously

Re: [sqlite] sqlite3ExprCodeIN() problems with SQLITE_OMIT_SUBQUERY

2009-12-01 Thread Ralf Junker
On 01.12.2009 18:35, Jay A. Kreibich wrote: > Important Note: The SQLITE_OMIT_* compile-time options are > unsupported. Oops! Thanks for focusing my eyes - they tend to skip introductions and move right to the details. Now having that read, let me point out that in spite of the statement the

Re: [sqlite] sqlite3ExprCodeIN() problems with SQLITE_OMIT_SUBQUERY

2009-12-01 Thread Jay A. Kreibich
On Tue, Dec 01, 2009 at 06:17:49PM +0100, Ralf Junker scratched on the wall: > Reading > >http://www.sqlite.org/compile.html > > always made me believe that all options to omit features are supported. Read closer: 1.6 Options To Omit Features ... Important Note: The

Re: [sqlite] sqlite3ExprCodeIN() problems with SQLITE_OMIT_SUBQUERY

2009-12-01 Thread Ralf Junker
On 01.12.2009 18:05, D. Richard Hipp wrote: > The key point to bare in mind here is that SQLITE_OMIT_SUBQUERY is > not a supported compile-time option. None of the major users of > SQLite make use of SQLITE_OMIT_SUBQUERY. We do not test it. And it > appears that it is broken in the current

Re: [sqlite] sqlite3ExprCodeIN() problems with SQLITE_OMIT_SUBQUERY

2009-12-01 Thread D. Richard Hipp
On Dec 1, 2009, at 11:53 AM, Ralf Junker wrote: > Compiling with SQLITE_OMIT_SUBQUERY, sqlite3ExprCodeIN() is compiled > out > but at the same time still required at other places in expr.c. > > As such, expr.c does not link well with SQLITE_OMIT_SUBQUERY defined. > > After I wrapped the

[sqlite] sqlite3ExprCodeIN() problems with SQLITE_OMIT_SUBQUERY

2009-12-01 Thread Ralf Junker
Compiling with SQLITE_OMIT_SUBQUERY, sqlite3ExprCodeIN() is compiled out but at the same time still required at other places in expr.c. As such, expr.c does not link well with SQLITE_OMIT_SUBQUERY defined. After I wrapped the remaining references to sqlite3ExprCodeIN() by #ifndef

[sqlite] Problem with #include in fts3Int.h

2009-12-01 Thread Ralf Junker
I have a compilation problem with line 22 in fts3Int.h: #include According to http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html, includes are used for system header files, which sqlite3.h is not IMHO. I tried to replace with #include "sqlite3.h" but this resulted in a number of

[sqlite] SQLITE_BUSY

2009-12-01 Thread Mike Johnston
I have two threads in a Linux process using sqlite 3.6.12 in shared cache mode. One thread opens the database file in read only mode (sqlite3_open_v2()), sets to read uncommitted and only ever performs selects from the database. The other thread inserts, updates and deletes rows from the

Re: [sqlite] Error message from sqlite3_tokenizer_module.xCreate?

2009-12-01 Thread Ralf Junker
On 01.12.2009 09:01, Dan Kennedy wrote: > I don't think it is possible at the moment. Unfortunately. Thanks for the clarification, Dan! I observe that you are currently writing the "official" FTS3 documentation in preparation for the next release of SQLite. Maybe you want to make tokenizer

Re: [sqlite] .read command

2009-12-01 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 FrankLane wrote: > Can I pass parameters to the .read command? Like "select * from test where > data=whatever" and then pass the value of whatever to the .read file > somehow? No. Doing this is starting the slippery slope of becoming a programming

Re: [sqlite] Error message from sqlite3_tokenizer_module.xCreate?

2009-12-01 Thread Dan Kennedy
On Dec 1, 2009, at 2:17 PM, Ralf Junker wrote: > On 30.11.2009 20:33, Grzegorz Wierzchowski wrote: >> Monday 30 of November 2009 12:29:10 Ralf Junker napisał(a): >>> I am passing various arguments to >>> sqlite3_tokenizer_module.xCreate. In case >>> they are invalid, I would like to return an