[sqlite] Is this a proper call?

2013-11-30 Thread Igor Korot
Hi, ALL, Is this a proper call to execute: if( sqlite3_exec( m_handle, "PRAGMA foreign_keys = OFF", NULL, NULL, 0 ) != SQLITE_OK ) { // displaying error message } The problem is that after successful execution of such code, I am still getting error: "foreign key constraint failed" when

Re: [sqlite] Need advice on using nested selects in JOIN statements as a logical 'AND'

2013-11-30 Thread Simon Slavin
On 1 Dec 2013, at 4:51am, Tristan Van Berkom wrote: > Do you have a suggestion which does not make an assumption about what > is the highest value of a character ? No. The trick is common in many computer languages and I've never seen a good formulaic way of doing

Re: [sqlite] Need advice on using nested selects in JOIN statements as a logical 'AND'

2013-11-30 Thread Tristan Van Berkom
On Sun, 2013-12-01 at 00:40 +, Simon Slavin wrote: > On 30 Nov 2013, at 5:40pm, Tristan Van Berkom wrote: > > > So, is there a way that I can tell SQLite forcibly to > > prioritize the index on email_list.value when making > > a prefix match ? > > Don't use LIKE or

Re: [sqlite] Bug in sqlite.exe? NOT !

2013-11-30 Thread Eric Teutsch
Thanks for that great detailed answer. I've been meaning to figure out manifests, your introduction to that subject convinced me to learn more about it. Cheers. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of RSmith Sent:

Re: [sqlite] Bug in sqlite.exe? NOT !

2013-11-30 Thread RSmith
The virtualization and UAC caused many a headache for unsuspecting programmers not used to the Linux way. It's a brilliant new way they do it but they had to move from an old way to a the new way in a way that wouldn't break old Windows programs (too much). Virtualization provided just the trick

Re: [sqlite] Need advice on using nested selects in JOIN statements as a logical 'AND'

2013-11-30 Thread Simon Slavin
On 30 Nov 2013, at 5:40pm, Tristan Van Berkom wrote: > So, is there a way that I can tell SQLite forcibly to > prioritize the index on email_list.value when making > a prefix match ? Don't use LIKE or GLOB for prefix matches. Although you as a human can tell that

Re: [sqlite] Bug in sqlite.exe? NOT !

2013-11-30 Thread Eric Teutsch
Yep, that's the reason. Thanks to Marcus and Clemens (with an extra high-5 for the link) for figuring it out, and everybody for suggestions. Now to figure out where to put the database so that non-admins can see the same file as admins... Eric -Original Message- From:

Re: [sqlite] Concrete example of corruption

2013-11-30 Thread Richard Hipp
On Sat, Nov 30, 2013 at 5:15 PM, L. Wood wrote: > Thanks, that makes sense. > > But I can pretty much rule this case out. In my case, it's highly unlikely > that the folder would be moved during the brief instant between _open() and > the actual opening of the "-journal" file.

Re: [sqlite] Concrete example of corruption

2013-11-30 Thread L. Wood
Thanks, that makes sense. But I can pretty much rule this case out. In my case, it's highly unlikely that the folder would be moved during the brief instant between _open() and the actual opening of the "-journal" file. Are there other possible cases of corruption?

Re: [sqlite] Need advice on using nested selects in JOIN statements as a logical 'AND'

2013-11-30 Thread Donald Griggs
Tristan, My apologies to you and the list if you mentioned this earlier, but I assume you've run the analyze command on your database, right? http://www.sqlite.org/lang_analyze.html Also possibly relevant: http://www.sqlite.org/compile.html#enable_stat3 (Of course, Igor's suggestion of the

Re: [sqlite] Concrete example of corruption

2013-11-30 Thread Clemens Ladisch
L. Wood wrote: > /Users/lwood/Desktop/folder/db.sqlite > > Suppose I can only move/rename the *folder*. Suppose I never mess with the > folder's contents. > > Can you name me a concrete example of corruption that could occur? 1. Open "/Users/lwood/Desktop/folder/db.sqlite". 2. Rename the folder.

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Clemens Ladisch
Marcus Grimm wrote: > You have the DB file in ProgramData, maybe you are a victim of the > windows file virtualization ? Given the symptoms, this is very likely. See . Regards, Clemens ___ sqlite-users mailing

Re: [sqlite] Inefficient query plan in queries with multiple joins

2013-11-30 Thread George
On Sat, Nov 30, 2013 at 1:55 PM, Richard Hipp wrote: > > If you have a LIMIT 25, then the TEMP B-TREE never holds more than 25 rows, > specifically the top 25 rows seen so far. But SQLite still has to scan > through the entire results set looking for other rows that belong in

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Eric Teutsch
alternate stream? What do you mean? Are you referring to the :1 in the path? this would be something in QTADO or the ODBC driver. I have an ODBC system DSN that contains a straight-forward path to c:\ProgramData\... -Original Message- From: sqlite-users-boun...@sqlite.org

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Keith Medcalf
Why are you using an alternate stream for the directory? >-Original Message- >From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >boun...@sqlite.org] On Behalf Of Simon Slavin >Sent: Saturday, 30 November, 2013 12:15 >To: General Discussion of SQLite Database >Subject: Re:

[sqlite] comiling sqlite.....

2013-11-30 Thread Luuk
Hi, i'm new at compiling stuff, and trying out some things... ;) I downloaded the sources last week (27nov) from http://www.sqlite.org/cgi/src/timeline?y=ci, and i got this file: SQLite-83c0bb9913838d18.tar.gz Question1: Is this the correct source for SQLite 3.8.2? or, How and where can i

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Marcus Grimm
Am 2013-11-30 20:04, schrieb Eric Teutsch: Sorry, should have pointed out that the "missing" tables are: CollectionDevices and CollectionChannels You have the DB file in ProgramData, maybe you are a victim of the windows file virtualization ? Try to use a different folder and see if that

Re: [sqlite] Does SQLIte run under Windows CE?

2013-11-30 Thread J Trahair
Thank you everyone. Jonathan ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Eric Teutsch
The integrity_check returned "OK" in sqlite.exe. Tonight I will rebuild the database and upgrade everything to run 3.8.1. I understand your thinking about bugs and SQLite vs other things (even though it's a bit NIMBY). It's just strange that something works in 3rd party tool, but doesn't work

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Simon Slavin
On 30 Nov 2013, at 7:03pm, Eric Teutsch wrote: > I've taken a picture of the odbc tool (showing the tables and the database > name) and sqlite.exe with .database and .table showing. You can see it > here: http://www.powersoft.ca/files/sqlite.png > It's the same file...

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Eric Teutsch
Sorry, should have pointed out that the "missing" tables are: CollectionDevices and CollectionChannels -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Eric Teutsch Sent: November-30-13 14:04 To: 'General Discussion of SQLite

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Eric Teutsch
I've taken a picture of the odbc tool (showing the tables and the database name) and sqlite.exe with .database and .table showing. You can see it here: http://www.powersoft.ca/files/sqlite.png It's the same file... -Original Message- From: sqlite-users-boun...@sqlite.org

Re: [sqlite] Need advice on using nested selects in JOIN statements as a logical 'AND'

2013-11-30 Thread Igor Tandetnik
On 11/30/2013 12:40 PM, Tristan Van Berkom wrote: However, in a statement formed like the one you proposed above, it screws with the query optimizer in SQLite I suspect, i.e. when searching for a prefix on an email address, SQLite (I suspect) decides to prioritize the UID index instead of the

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Igor Tandetnik
On 11/30/2013 11:55 AM, Eric Teutsch wrote: .Tables doesn't show the 2 new tables. A select statement on one of those tables says "No such table". And "select * from sqlite_master" shows the 8 tables and 1 trigger. And ends there. But when using sqliteodbc, I can run the select statement on

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Eric Teutsch
The database has been closed and opened many times, by both the application, as well as different adhoc query interfaces (sqlite.exe, sqlite expert, qtado -- I've made sure that all access is terminated). The database has been deleted (no complaints like file is in use...) and regenerated with

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Simon Slavin
On 30 Nov 2013, at 5:43pm, Eric Teutsch wrote: > That is an interesting concept and could explain another weirdness - my > sqliteodbc connection always tells me that the database is readonly. Is > there a way to find out if a database is in a transaction and waiting for a >

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Simon Slavin
On 30 Nov 2013, at 3:01pm, Eric Teutsch wrote: > Hi, I've got a database (3.7.16.1) which has a bunch of tables and 2 > triggers. The order of creation is 8 tables, 2 triggers, 2 tables. When > looking at the database with the ODBC client (sqliteodb 0.992), I can see >

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Eric Teutsch
That is an interesting concept and could explain another weirdness - my sqliteodbc connection always tells me that the database is readonly. Is there a way to find out if a database is in a transaction and waiting for a commit or a rollback? -Original Message- From:

Re: [sqlite] Need advice on using nested selects in JOIN statements as a logical 'AND'

2013-11-30 Thread Tristan Van Berkom
On Thu, 2013-11-28 at 00:20 -0500, Igor Tandetnik wrote: > On 11/27/2013 11:52 PM, Tristan Van Berkom wrote: > > > > SELECT DISTINCT summary.uid, summary.vcard FROM 'folder_id' AS summary > > LEFT OUTER JOIN 'folder_id_phone_list' AS phone_list > >

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Eric Teutsch
It works fine with SQLite Expert, using same version of SQLite as sqlite.exe Thanks for all suggestions -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Stephen Chrzanowski Sent: November-30-13 11:35 To: General Discussion of

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Keith Medcalf
COMMIT ? >-Original Message- >From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >boun...@sqlite.org] On Behalf Of Eric Teutsch >Sent: Saturday, 30 November, 2013 09:56 >To: 'General Discussion of SQLite Database' >Subject: Re: [sqlite] Bug in sqlite.exe? > >.Tables doesn't show

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Eric Teutsch
No, all names are without spaces. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Mohit Sindhwani Sent: November-30-13 11:59 To: General Discussion of SQLite Database Subject: Re: [sqlite] Bug in sqlite.exe? On 1/12/2013

Re: [sqlite] Does SQLIte run under Windows CE?

2013-11-30 Thread Mohit Sindhwani
On 30/11/2013 1:28 AM, J Trahair wrote: Does SQLIte run under Windows CE? And if so, which version should I download? Thank you. J Trahair Yes, we are using various versions of 3.7.xx in Windows CE 5.0 and 6.0 without any problems. Best Regards, Mohit. 1/12/2013 | 12:59 AM.

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Mohit Sindhwani
On 1/12/2013 12:55 AM, Eric Teutsch wrote: .Tables doesn't show the 2 new tables. A select statement on one of those tables says "No such table". And "select * from sqlite_master" shows the 8 tables and 1 trigger. And ends there. But when using sqliteodbc, I can run the select statement on a

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Eric Teutsch
.Tables doesn't show the 2 new tables. A select statement on one of those tables says "No such table". And "select * from sqlite_master" shows the 8 tables and 1 trigger. And ends there. But when using sqliteodbc, I can run the select statement on a new table. -Original Message- From:

Re: [sqlite] Percentile function in SQLite 3.8.0 (for the .NET version)

2013-11-30 Thread Igor Tandetnik
On 11/29/2013 6:38 PM, Hayden Livingston wrote: I have a table {operationId, latency) with a set of rows that have floating values for latencies of a given operation. I want to find the 25th %ile latency for this rowset. If you mean "a value X such that 25% of all operations had latency

Re: [sqlite] Inefficient query plan in queries with multiple joins

2013-11-30 Thread Jim Callahan
Would the rtree be useful in a composite primary key and/or ad-hoc composite query context? http://www.sqlite.org/rtree.html If so, how would SQLite know to create and/or use an rtree without explicit user intervention? Jim Callahan > But this does point out a possible enhancement to SQLite: >

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Igor Tandetnik
On 11/30/2013 10:01 AM, Eric Teutsch wrote: But when I look at the database with sqlite.exe (3.8.0.1), I see the 8 of tables and 1 trigger. I cannot query the remaining two tables. Define "cannot". Exactly what happens when you try? What do you mean by "see" - see where and how? Can you

Re: [sqlite] Bug in sqlite.exe?

2013-11-30 Thread Stephen Chrzanowski
Try using SQLite Expert (For your short term use, use the free version) and see if you can pull up the DB. You can select which DLL you want to use and see if its a library issue or if its something to do with the database, or whatever else. I have a bunch of DLLs in my VCS that I can extract

[sqlite] Bug in sqlite.exe?

2013-11-30 Thread Eric Teutsch
Hi, I've got a database (3.7.16.1) which has a bunch of tables and 2 triggers. The order of creation is 8 tables, 2 triggers, 2 tables. When looking at the database with the ODBC client (sqliteodb 0.992), I can see 100% of the tables (I use QTADO as my interactive tool, and it doesn't show

Re: [sqlite] Percentile function in SQLite 3.8.0 (for the .NET version)

2013-11-30 Thread RSmith
Hi Hayden, The most usual form of percentile function (I believe) is where you have record values in a selection set (or "sample" from a "population" for the astute statisticians), and you wish to know if you sorted them all by value, and then grouped them in clusters of 1% so that you have a

[sqlite] Concrete example of corruption

2013-11-30 Thread L. Wood
Let me put it this way: Suppose I have my main database file *in a folder*: /Users/lwood/Desktop/folder/db.sqlite Suppose I can only move/rename the *folder*. Suppose I never mess with the folder's contents. Can you name me a concrete example of corruption that could occur? It seems that all

Re: [sqlite] Does SQLIte run under Windows CE?

2013-11-30 Thread Richard Hipp
On Fri, Nov 29, 2013 at 12:28 PM, J Trahair wrote: > Does SQLIte run under Windows CE? And if so, which version should I > download? > Yes. All versions should work on WinCE. See, for example, release test 10j for version 3.8.1:

Re: [sqlite] Does SQLIte run under Windows CE?

2013-11-30 Thread Stephan Beal
On Fri, Nov 29, 2013 at 6:28 PM, J Trahair wrote: > Does SQLIte run under Windows CE? And if so, which version should I > download? > i know that the version which was current in late 2007 ran on WinCE, but i haven't tried any newer versions. -- - stephan

[sqlite] Bug: Namespace System.Data.SQLite.Linq not accessible in Visual Studio 2013 Express

2013-11-30 Thread Vladimir Bradaska
Hello, guys. I want to report bug... Namespace System.Data.SQLite.Linq not accessible in Visual Studio 2013 Express Steps to reproduce bug: Windows7x64SP1 machine, Visual Studio 2013 Express for Desktop [Installation date: 27. 11. 2013], New Console C# project...install SQLite package...

[sqlite] Percentile function in SQLite 3.8.0 (for the .NET version)

2013-11-30 Thread Hayden Livingston
Is there any documentation or use case for percentile queries? I've only seen the source code checked in by "drh". Is it like the EXCEL 2013 function? I have a table {operationId, latency) with a set of rows that have floating values for latencies of a given operation. I want to find the 25th

[sqlite] Does SQLIte run under Windows CE?

2013-11-30 Thread J Trahair
Does SQLIte run under Windows CE? And if so, which version should I download? Thank you. J Trahair ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Inefficient query plan in queries with multiple joins

2013-11-30 Thread Richard Hipp
On Sat, Nov 30, 2013 at 7:08 AM, Simon Slavin wrote: > > On 30 Nov 2013, at 10:24am, George wrote: > > > I have noticed that when I order using just one column then the query is > > very fast, because no TEMP B-TREE is used. When I add the other

Re: [sqlite] Inefficient query plan in queries with multiple joins

2013-11-30 Thread Simon Slavin
On 30 Nov 2013, at 10:24am, George wrote: > I have noticed that when I order using just one column then the query is > very fast, because no TEMP B-TREE is used. When I add the other columns > then TEMP B-TREE is used and the query is very slow. Do you have indexes on

Re: [sqlite] Inefficient query plan in queries with multiple joins

2013-11-30 Thread Richard Hipp
On Sat, Nov 30, 2013 at 5:24 AM, George wrote: > I have a query that is used to populate a table in my website. The query > joins 4 different tables and returns around 10 columns, and I want to order > on 4 of them, each of those 4 being on a different table. I also use a

Re: [sqlite] Inefficient query plan in queries with multiple joins

2013-11-30 Thread Kees Nuyt
On Sat, 30 Nov 2013 12:24:01 +0200, George wrote: >I have a query that is used to populate a table in my website. The query >joins 4 different tables and returns around 10 columns, and I want to order >on 4 of them, each of those 4 being on a different table. I also use a

[sqlite] Inefficient query plan in queries with multiple joins

2013-11-30 Thread George
I have a query that is used to populate a table in my website. The query joins 4 different tables and returns around 10 columns, and I want to order on 4 of them, each of those 4 being on a different table. I also use a LIMIT clause for pagination. I have noticed that when I order using just one