Re: [sqlite] Literature on the information theory behind SQL(lite)?

2013-07-09 Thread Jay A. Kreibich
On Tue, Jul 09, 2013 at 11:22:35PM +0200, Stephan Beal scratched on the wall: > On Tue, Jul 9, 2013 at 7:24 PM, Paolo Bolzoni > wrote: > > > I am sorry the part that look Greek to you is actually fairly > > important base of the theory behind SQL, the relational

[sqlite] sqlite3_column_count vs sqlite_data_count

2013-07-09 Thread Peter Aronson
It seems like a very subtle difference, but I think sqlite3_column_count will return the number of columns returned by a prepared statement regardless of whether there is data available to get with sqlite3_column_* functions, whereas sqlite3_data_count requires that there be a current result

Re: [sqlite] Reference to an undefined field

2013-07-09 Thread Simon Slavin
On 9 Jul 2013, at 11:54pm, Igor Korot wrote: > Shouldn't the engine warn you? > What I mean is: developer don't know that he fail with the query results > until further execution or running the program under debugger and explore > the data. > I'm not saying it's wrong, I'm

Re: [sqlite] Reference to an undefined field

2013-07-09 Thread Igor Korot
Igor, On Tue, Jul 9, 2013 at 3:42 PM, Igor Tandetnik wrote: > On 7/9/2013 6:37 PM, Igor Korot wrote: > >> Hi, ALL, >> Consider following code: >> >> std::string query = "SELECT a FROM foo;"; >> >> sqlite3_prepare_v2( handle, query, -1, , 0 ); >> sqlite3_step( stmt ); >> int

Re: [sqlite] Reference to an undefined field

2013-07-09 Thread Igor Tandetnik
On 7/9/2013 6:37 PM, Igor Korot wrote: Hi, ALL, Consider following code: std::string query = "SELECT a FROM foo;"; sqlite3_prepare_v2( handle, query, -1, , 0 ); sqlite3_step( stmt ); int id = sqlite_column_int( stmt, 0 ); int code = sqlite3_column_int( stmt, 1 ); Shouldn't the engine assert

[sqlite] Reference to an undefined field

2013-07-09 Thread Igor Korot
Hi, ALL, Consider following code: std::string query = "SELECT a FROM foo;"; sqlite3_prepare_v2( handle, query, -1, , 0 ); sqlite3_step( stmt ); int id = sqlite_column_int( stmt, 0 ); int code = sqlite3_column_int( stmt, 1 ); Shouldn't the engine assert in this case? Thank you.

Re: [sqlite] Literature on the information theory behind SQL(lite)?

2013-07-09 Thread Stephan Beal
On Tue, Jul 9, 2013 at 7:24 PM, Paolo Bolzoni wrote: > I am sorry the part that look Greek to you is actually fairly > important base of the theory behind SQL, the relational algebra. > Bad news for me ;), but you've given me a new search term: relational

Re: [sqlite] SQLite Use of Indexes

2013-07-09 Thread Simon Slavin
On 9 Jul 2013, at 6:06pm, peter korinis wrote: > So, to implement your suggestion of crafting better indices, here’s my > approach: > 1. First action is joining the 2 tables on claim_no. {Therefore > claim_no should be first row in index for both tables} > 2.

Re: [sqlite] Literature on the information theory behind SQL(lite)?

2013-07-09 Thread Paolo Bolzoni
I am sorry the part that look Greek to you is actually fairly important base of the theory behind SQL, the relational algebra. A possible answer to your question is the classic book: Database Systems, The complete book of Ullman et. all. It is comprehensive, so it should satisfy all your

[sqlite] Literature on the information theory behind SQL(lite)?

2013-07-09 Thread Stephan Beal
Hi, all, i am looking for literature which describes the data/information theory/formalisms behind sqlite and similar projects. Google has so far led me to the extremes of "introduction to SQL" (don't need it) and articles which start using Greek symbols in the 3rd paragraph (and which point my

Re: [sqlite] SQLite Use of Indexes

2013-07-09 Thread peter korinis
Thank you Simon for responding to my questions. Your phonebook (FName/LName) analogy clearly explained why 2 indices per table per select won't work. Let me provide a bit more info and a possible attempt to implement your suggestions for better indices. My 'bread and butter' query counts the

Re: [sqlite] Unlock Notify problems

2013-07-09 Thread Dan Kennedy
On 07/09/2013 11:10 PM, Owen Haynes wrote: Here is some information I have gathered. We have a writer thread connection called A and a reader called B, another reader called C. A is writing B is waiting on A with pBlockingConnection = A, and pUnlockConnection A A is Now done, A is waiting on

Re: [sqlite] Unlock Notify problems

2013-07-09 Thread Owen Haynes
Here is some information I have gathered. We have a writer thread connection called A and a reader called B, another reader called C. A is writing B is waiting on A with pBlockingConnection = A, and pUnlockConnection A A is Now done, A is waiting on B with pBlockingConnection = B and

[sqlite] Convert Sqlserver script to Sqlite script

2013-07-09 Thread veeresh kumar
Hi,  Is there any tool which would convert a sql server script to sqlite script? Thank you ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Unstable ON DELETE actions

2013-07-09 Thread Roland Wilczek
> Igor wrote: > So don't create two foreign keys that come into conflict. I would never do, but the users of my tool could make that mistake. And then my tool must do, what SQLite does. Problem: SQLite's behaviour is hard to predict and tends to surprise you. Thats the reason for my questions:

Re: [sqlite] Unstable ON DELETE actions

2013-07-09 Thread Clemens Ladisch
I wrote: > Roland Wilczek wrote: >> CREATE TABLE track (artist, >> FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE CASCADE >> FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE RESTRICT); > > This particular statement creates a table with a single foreign key > constraint. Sorry, I was

Re: [sqlite] Unstable ON DELETE actions

2013-07-09 Thread Roland Wilczek
> Clemens wrote: > > > > CREATE TABLE track (artist, > > FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE CASCADE > > FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE RESTRICT); > > SQLite allows pretty much anything inside a CREATE TABLE statement, and > ignores anything it doesn't

Re: [sqlite] Unstable ON DELETE actions

2013-07-09 Thread Clemens Ladisch
Roland Wilczek wrote: > - If two foreign keys come into conflict, SQLite silently ignores one of them > instead of raising an error. > > CREATE TABLE track (artist, > FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE CASCADE > FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE RESTRICT);

Re: [sqlite] Unstable ON DELETE actions

2013-07-09 Thread Igor Tandetnik
On 7/9/2013 8:50 AM, Roland Wilczek wrote: - The order of execution of ON DELETE action is not well documented. As far as I can tell, it's unspecified, subject to change without notice, and should be treated as unpredictable. If you want a deterministic order, create a single ON DELETE

[sqlite] Unstable ON DELETE actions

2013-07-09 Thread Roland Wilczek
Hi *, I am sorry to introduce myself to this list with such a long posting. And I am even more sorry to post such critical content! Forgive me. I am developing an ORM-tool, which as a part of it's tasks, emulates ON DELETE actions of the underlying RDBMS. Accidentally I came across some

Re: [sqlite] Android : UNIQUE makes my DB go crazy

2013-07-09 Thread Clemens Ladisch
Sorin Grecu wrote: > I'm having an issue with my app. Already solved: ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Android : UNIQUE makes my DB go crazy

2013-07-09 Thread Sorin Grecu
I'm having an issue with my app. What my app does is this : gets some data from a couple of edittexts(3 per row,created dynamically) and puts them in a database. What i want the database to do is this : take the `product name`,the `quantity` and the `price` and put them in the table.The name

[sqlite] adding some more details on the documentation

2013-07-09 Thread Karim DRIDI
Hello, I had some difficulties using sqlite3_create_function in that example : https://gist.github.com/kdridi/621a12f9a7d6ac12309a Using sqlite v3.7.17 and -std=c++11 After looking around, i finally understood that the sixth, seventh and eighth parameters, xFunc, xStep and xFinal must be -

Re: [sqlite] Unlock Notify problems

2013-07-09 Thread Dan Kennedy
On 07/09/2013 06:41 PM, Owen Haynes wrote: I have been using a debugger to look at pBlockedConnection and pUnlockConnection also added some extra print statements to the code, sqlite is also compiled with debug enabled, and no asserts seem to get triggered. How do you know A has finished?

Re: [sqlite] Unlock Notify problems

2013-07-09 Thread Owen Haynes
I have been using a debugger to look at pBlockedConnection and pUnlockConnection also added some extra print statements to the code, sqlite is also compiled with debug enabled, and no asserts seem to get triggered. Owen On 9 July 2013 11:20, Dan Kennedy wrote: > On

Re: [sqlite] Unlock Notify problems

2013-07-09 Thread Dan Kennedy
On 07/09/2013 04:08 PM, Dan Kennedy wrote: On 06/20/2013 03:20 PM, Owen Haynes wrote: Hello, I am currently having some problems with the unlock notify and getting in a state of deadlock. I am using code based on http://www.sqlite.org/unlock_notify.html, with the latest sqlite. The setup

Re: [sqlite] Unlock Notify problems

2013-07-09 Thread Owen Haynes
Yes I am covering the case where xNotify is called before sqlite3_unlock_notify is returned. My struct which I pass into sqlite3_unlock_notify has a fired flag, this would then get set to true if xNotify is called in sqlite3_unlock_notify. This flag is then checked after the sqlite3_unlock_notify

Re: [sqlite] Unlock Notify problems

2013-07-09 Thread Dan Kennedy
On 06/20/2013 03:20 PM, Owen Haynes wrote: Hello, I am currently having some problems with the unlock notify and getting in a state of deadlock. I am using code based on http://www.sqlite.org/unlock_notify.html, with the latest sqlite. The setup is as follows: - WAL is on - Multi Threaded

Re: [sqlite] Unlock Notify problems

2013-07-09 Thread Owen Haynes
I am still having this problem, and it happens very frequently. Some more information Normally have 7 connections on different threads, 2 of these threads are writers Owen On 20 Jun 2013 09:20, "Owen Haynes" wrote: > Hello, > > I am currently having some problems with the