Re: [sqlite] find sequential groups

2012-10-16 Thread Igor Tandetnik
Bart Smissaert wrote: > To do with the same, what is wrong with this update SQL? > > update final2 > set group_count = > (select count(*) > from > final2 > group by > group_marker) > > It makes group_count always 1 The subquery does not depend on the values in the row being updated. It always

Re: [sqlite] new Windows versions?

2012-10-16 Thread Darren Duncan
TaxDetective wrote: Hi Darren are you on your own yet? Yes, I moved into my own place 3 months ago, in downtown Victoria. I'm currently at: unit 110, 915 Cook Street, Victoria, BC, V8V3Z4 My phone number is 778-265-1827. This is a land-line (Shaw digital, with unlimited NA long dis

[sqlite] Technical article on SQLite

2012-10-16 Thread Simon Slavin
"In this first article exploring SQLite's internal workings, we look at SQLite's Virtual Database Engine (VDBE), a virtual machine which executes code generated from SQL commands to store and retrieve data." Not ve

Re: [sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
To do with the same, what is wrong with this update SQL? update final2 set group_count = (select count(*) from final2 group by group_marker) It makes group_count always 1, but should include higher values. The select by itself gives the right result. RBS On Wed, Oct 17, 2012 at 12:31 AM, Bart S

Re: [sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
Without the concatenation it runs fine, enormously faster than with the concatenation. Have checked and the result is fine as well. Thanks again. RBS On Tue, Oct 16, 2012 at 11:38 PM, Igor Tandetnik wrote: > On 10/16/2012 6:29 PM, Bart Smissaert wrote: >> >> Actually, it really is slow, made wo

Re: [sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
Thanks, will give that a try as well. RBS On Wed, Oct 17, 2012 at 12:00 AM, Black, Michael (IS) wrote: > Ok...how about with triggers then? > This will give a unique number to each sequence as you insert them. > > CREATE TABLE Test(ID,Value,Group_Marker); > CREATE TRIGGER insert_trigger1 after

Re: [sqlite] Support of cascading updates and deletes

2012-10-16 Thread Richard Hipp
On Tue, Oct 16, 2012 at 7:12 PM, Kris Peters wrote: > I¹m new to sqlite; I took the lazy way out and downloaded the sqlite3 > precompiled binaries for Mac OS X. Creating tables, doing queries, and > noncascading deletes and updates work fine. But specifying any kind of > cascading update and del

[sqlite] Support of cascading updates and deletes

2012-10-16 Thread Kris Peters
I¹m new to sqlite; I took the lazy way out and downloaded the sqlite3 precompiled binaries for Mac OS X. Creating tables, doing queries, and noncascading deletes and updates work fine. But specifying any kind of cascading update and deletes seems to be ignored. What do you recommend? Kris Peters

Re: [sqlite] find sequential groups

2012-10-16 Thread Black, Michael (IS)
Ok...how about with triggers then? This will give a unique number to each sequence as you insert them. CREATE TABLE Test(ID,Value,Group_Marker); CREATE TRIGGER insert_trigger1 after insert on Test WHEN new.id=1 BEGIN UPDATE Test set Group_Marker=1; END; CREATE TRIGGER insert_trigger2 after inser

Re: [sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
Thanks, will try that. Yes, the ID field is an integer primary key autoincrement. Still running the old sql with concatenation. Looks I may need to kill that. RBS On Tue, Oct 16, 2012 at 11:38 PM, Igor Tandetnik wrote: > On 10/16/2012 6:29 PM, Bart Smissaert wrote: >> >> Actually, it really is s

Re: [sqlite] find sequential groups

2012-10-16 Thread Igor Tandetnik
On 10/16/2012 6:29 PM, Bart Smissaert wrote: Actually, it really is slow, made worse by the fact that there is not one grouping field (value in my example), but three. I am running your SQL now, concatenating these 3 fields, but still running and looks will be a long time. Will have to improve it

Re: [sqlite] EXT : find sequential groups

2012-10-16 Thread Bart Smissaert
Yes, that should be 4 groups, marked with 1, 2, 3 and 4. RBS On Tue, Oct 16, 2012 at 11:15 PM, Igor Tandetnik wrote: > On 10/16/2012 6:08 PM, Black, Michael (IS) wrote: >> >> Do this work for you? >> >> CREATE TABLE Groups (Value); >> insert into Groups select distinct(Value) from test; > > > S

Re: [sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
Thanks, very nice solution that! Yes, I realise that this is a lot faster in code, but for now that is no option. Actually, it really is slow, made worse by the fact that there is not one grouping field (value in my example), but three. I am running your SQL now, concatenating these 3 fields, but s

Re: [sqlite] EXT : find sequential groups

2012-10-16 Thread Igor Tandetnik
On 10/16/2012 6:08 PM, Black, Michael (IS) wrote: Do this work for you? CREATE TABLE Groups (Value); insert into Groups select distinct(Value) from test; Since the OP mentioned "sequential groups", I assumed that a sequence like "A,A,B,B,A,A,B,B" should count as four groups, not two as your

Re: [sqlite] EXT : find sequential groups

2012-10-16 Thread Black, Michael (IS)
Do this work for you? CREATE TABLE Test(ID,Value,Group_Marker); INSERT INTO "Test" VALUES(1,'D',0); INSERT INTO "Test" VALUES(2,'X',0); INSERT INTO "Test" VALUES(3,'X',0); INSERT INTO "Test" VALUES(4,'X',0); INSERT INTO "Test" VALUES(5,'A',0); INSERT INTO "Test" VALUES(6,'B',0); SELECT * FROM Test

Re: [sqlite] find sequential groups

2012-10-16 Thread Igor Tandetnik
On 10/16/2012 4:56 PM, Bart Smissaert wrote: Trying to make a query that can mark records, indicating them to belong to a sequential group. Giving the most simple example: IDValue Group_Marker --- 1 D1 2 X 2 3 X 2 4

[sqlite] find sequential groups

2012-10-16 Thread Bart Smissaert
Trying to make a query that can mark records, indicating them to belong to a sequential group. Giving the most simple example: IDValue Group_Marker --- 1 D1 2 X 2 3 X 2 4 X 2 5 A 3 6 B

Re: [sqlite] sqlite3.dll no longer operative

2012-10-16 Thread Navaneeth.K.N
On Oct 11, 2012 5:58 PM, "L. Dale Rohl" wrote: > > I am using 64bit Window 7 on my stand alone Toshiba Computer. Recently I > lost a Hard Drive and had it replaced. All is well but during activation of > the computer a pop-up is on the screen that says that "sqlite3.dll" has been > lost and I need

Re: [sqlite] System.Data.SQLite [nuGet] 1.0.82.0 dll issue

2012-10-16 Thread Bernhard Mogens Ege
I made it work by including "Content" files in the Application folder in the Setup project. The setup file installs perfectly now on a clean server. Everything is neat now. :) Bernhard -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On B

Re: [sqlite] 5. Re: Sqlite, Is it possible to calculate the length of the longest increasing subsequence using an UDF

2012-10-16 Thread Black, Michael (IS)
I knew I was missing somethingthanks for the correction and pointer...learn something new every day. Michael D. Black Senior Scientist Advanced Analytics Directorate Advanced GEOINT Solutions Operating Unit Northrop Grumman Information Systems From: s

Re: [sqlite] inserting record datinto mutliple tables with a composite primary key

2012-10-16 Thread Igor Tandetnik
LMHmedchem wrote: > I have data that I am loading into a sqlite database from a text file. I am > using a composite primary key for four ints for the main table. > > create table Structure ( > i1 integer not null, > i2 integer not null, > i3 integer not null, > i4 integer not null, > na

Re: [sqlite] System.Data.SQLite [nuGet] 1.0.82.0 dll issue

2012-10-16 Thread Joe Mistachkin
Bernhard Mogens Ege wrote: > > When building a setup project, the interop dll files are not included and > hence the program will not work when installed. Only the > System.Data.SQLite[.Linq].dll assemblies are included in the setup project. > My answer to this is largely "I don't know" as I h

[sqlite] 5 readers, 1 writer, shared cache and read uncommitted - repost

2012-10-16 Thread Bob Price
I asked this last Friday evening (which probably wasn't a good time) and didn't get any responses, so I thought I would try one more time.  I apologize for the duplication. This is a question to ask about a particular Sqlite usage configuration to see if it is appropriate or how to make it bet

Re: [sqlite] 5. Re: Sqlite, Is it possible to calculate the length of the longest increasing subsequence using an UDF

2012-10-16 Thread Igor Tandetnik
Black, Michael (IS) wrote: > Pseudo-code: > > lastchar=''; > For (char c in array) > if (lastchar = '' || c = lastchar+1) >curseq.push(c); > else >curseq.clear(); >curseq..push(c); > end The longest increasing subsequence doesn't need to be contiguous. Nor does the difference bet

[sqlite] System.Data.SQLite [nuGet] 1.0.82.0 dll issue

2012-10-16 Thread Bernhard Mogens Ege
Hi, Now that 1.0.82.0 is available as a nuget package, I tried to use it. I added the x32/x64 package and this completed without problems. It added the references and a x32 and x64 folder, each with SQLite.Interop.dll files. My problem: When building a setup project, the intero

Re: [sqlite] 5. Re: Sqlite, Is it possible to calculate the length of the longest increasing subsequence using an UDF

2012-10-16 Thread Black, Michael (IS)
Maybe I'm missing something (wouldn't surprise me) but I can think of O(n) traversal of the array for doing this. Not in SQL of course but you should be able to write a user function for it. Pseudo-code: lastchar=''; For (char c in array) if (lastchar = '' || c = lastchar+1) curseq.push

Re: [sqlite] Q: FTS 3-4 for WinRT

2012-10-16 Thread Kenneth Grant
No. I just did not see a definitive statement that it was included in the WinRT release. Thanks for the reply. Sent from my iPad On Oct 16, 2012, at 8:28 AM, Richard Hipp wrote: > On Mon, Oct 15, 2012 at 4:27 PM, Ken Grant wrote: > >> Q: any plans to have a FTS3/4 WinRT extension for Metro s

Re: [sqlite] Q: FTS 3-4 for WinRT

2012-10-16 Thread Richard Hipp
On Mon, Oct 15, 2012 at 4:27 PM, Ken Grant wrote: > Q: any plans to have a FTS3/4 WinRT extension for Metro style Win8 apps > and if so, when? > FTS3/4 has been working on WinRT builds for the past three releases. Are you having problems? > > Sent from my iPhone >

Re: [sqlite] subscribe to mailing list

2012-10-16 Thread Richard Hipp
On Mon, Oct 15, 2012 at 8:05 PM, LMH wrote: > Hello, > > I have tried to subscribe to this list by using the "subscribe" button at, > http://sqlite.1065341.n5.**nabble.com/mailing_list/** > MailingListOptions.jtp?forum=2

Re: [sqlite] Zeroblob initialization memory allocation issue

2012-10-16 Thread Richard Hipp
On Mon, Oct 15, 2012 at 4:15 PM, Petr Kovalev wrote: > Hello worldwide Sqlite team! > > We've found an issue caused by zeroblob initialization. Depending on the > table columns creation order, zeroblob initialization causes huge memory > allocation or not. > > Attached sample project is for Mono,

[sqlite] subscribe to mailing list

2012-10-16 Thread LMH
Hello, I have tried to subscribe to this list by using the "subscribe" button at, http://sqlite.1065341.n5.nabble.com/mailing_list/MailingListOptions.jtp?forum=2 I keep getting a bounced email from mailer-dae...@sam.nabble.com I don't know if I am subscribed to this group or not. Can someone le

[sqlite] inserting record datinto mutliple tables with a composite primary key

2012-10-16 Thread LMHmedchem
Hello, I have data that I am loading into a sqlite database from a text file. I am using a composite primary key for four ints for the main table. create table Structure ( i1 integer not null, i2 integer not null, i3 integer not null, i4 integer not null, name string not null, f

[sqlite] Q: FTS 3-4 for WinRT

2012-10-16 Thread Ken Grant
Q: any plans to have a FTS3/4 WinRT extension for Metro style Win8 apps and if so, when? Sent from my iPhone ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Zeroblob initialization memory allocation issue

2012-10-16 Thread Petr Kovalev
Hello worldwide Sqlite team! We've found an issue caused by zeroblob initialization. Depending on the table columns creation order, zeroblob initialization causes huge memory allocation or not. Attached sample project is for Mono, but we've tried the same scenario with native methods. In first

Re: [sqlite] System.Data.SQLite Field Name are surrounded by double quotes for Views

2012-10-16 Thread Vincent DARON
Thanks a lot ! Le 15/10/12 18:27, Joe Mistachkin a écrit : Vincent DARON wrote: There is now way to know if the query is on a View or a Table while generating the SQL. The core SQLite library has been enhanced to deal with this situation, here: http://www.sqlite.org/src/info/5526e0aa

Re: [sqlite] primary key with bulk insert (UNION SELECT)

2012-10-16 Thread Alan Frankel
I ended up modifying the statement to add NULL to the ROWID column for each row. SQLite silently replaces the NULL with an automatically generated row id. This works even in older versions, so this was the solution I ended up using. Thanks, Alan -Original Message- From: sqlite-users-bou

Re: [sqlite] Begin immediate transaction -> SQLITE_BUSY (database is locked)

2012-10-16 Thread Daniel Polski
One of the other threads is writing at the same time. SQLite only allows a single writer at a time to a single database file. Others have to wait in line. Your solution is that when you get an SQLITE_BUSY, delay for a short while and then try again. Keep trying until you break through. Note

Re: [sqlite] Begin immediate transaction -> SQLITE_BUSY (database is locked)

2012-10-16 Thread Richard Hipp
On Tue, Oct 16, 2012 at 4:33 AM, Daniel Polski wrote: > > Hello, > I have a hard time finding the cause of a bug in my application. I believe > that it's me doing something wrong and not sqlite since I can't reproduce > the error in a simple example. I have 4 threads mostly reading data from a > d

Re: [sqlite] Begin immediate transaction -> SQLITE_BUSY (database is locked)

2012-10-16 Thread Daniel Polski
Nothing obvious springs to mind but I do see that you are not checking the values returned by most of your sqlite_exec() calls. Perhaps you could write a little routine that does the sqlite_exec() and then asserts that the value returned is SQLITE_OK. It may be that it's actually one of the o

Re: [sqlite] Begin immediate transaction -> SQLITE_BUSY (database is locked)

2012-10-16 Thread Simon Slavin
On 16 Oct 2012, at 9:33am, Daniel Polski wrote: > What confuses me is that the "BEGIN IMMEDIATE TRANSACTION" sometimes fails > with a SQLITE_BUSY[5] (database is locked) after some iterations in the loop > even though all previous actions so far has returned SQLITE_OK. All > subsequent calls

Re: [sqlite] DatabaseError: database disk image is malformed

2012-10-16 Thread Clemens Ladisch
Keith Medcalf wrote: > Note that according to the Microsoft documentation opportunistic > locking is only used when overlapped I/O is enabled. That applies only to oplocks that are requested manually by an application through FSCTL_ control codes: http://msdn.microsoft.com/en-us/library/windows/de

[sqlite] Begin immediate transaction -> SQLITE_BUSY (database is locked)

2012-10-16 Thread Daniel Polski
Hello, I have a hard time finding the cause of a bug in my application. I believe that it's me doing something wrong and not sqlite since I can't reproduce the error in a simple example. I have 4 threads mostly reading data from a database, and all threads open "own" database connections. I'v