Re: [sqlite] SQLl question

2009-05-14 Thread John Machin
On 15/05/2009 2:37 PM, Dennis Cote wrote: > Evan Burkitt wrote: >> This isn't a Sqlite question per se, but I know there are some SQL gurus >> here who might have some insight into this problem. I apologize for >> being off-topic; I can be shameless when I need help. :)> >> >> I have three

Re: [sqlite] SQLl question

2009-05-14 Thread Dennis Cote
Evan Burkitt wrote: > This isn't a Sqlite question per se, but I know there are some SQL gurus > here who might have some insight into this problem. I apologize for > being off-topic; I can be shameless when I need help. :)> > > I have three tables, N, P and E. N contains the fields id and name.

[sqlite] SQLl question

2009-05-14 Thread Evan Burkitt
This isn't a Sqlite question per se, but I know there are some SQL gurus here who might have some insight into this problem. I apologize for being off-topic; I can be shameless when I need help. :)> I have three tables, N, P and E. N contains the fields id and name. The other two each contain

Re: [sqlite] Prepared statements must be generated inside your transaction

2009-05-14 Thread Dennis Cote
Joanne Pham wrote: > I have read one of the performance document and it stated that "prepared > statements must be generated inside transaction". Is that correct. > > So I have to do this: > begin transaction > prepared statement >.. > end transaction. > >

Re: [sqlite] heap corruption?

2009-05-14 Thread Tom Broadbent
turns out that someone else was trampling the heap. problem solved. thanks tom -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Dan Sent: Monday, April 06, 2009 9:57 PM To: General Discussion of SQLite Database Subject: Re:

Re: [sqlite] Should use prepare/bind or just sqlite_exec.

2009-05-14 Thread Scott Hess
In addition to performance, consider bugs and security. Read up on: http://en.wikipedia.org/wiki/SQL_injection I strive to always use the bind version of whatever database API I'm using, because constructing SQL leads to this kind of problem often enough that it's just not worth it. That's

Re: [sqlite] Should use prepare/bind or just sqlite_exec.

2009-05-14 Thread Sam Carleton
Joanne, Igor was saying: Assuming you are only doing one update either works and #2 is faster for you to implement. On the other hand, if there is a long list of id's to update, than #1 is faster if you only prepair the statement once and bind multiple times. On a side note, with respect

Re: [sqlite] Should use prepare/bind or just sqlite_exec.

2009-05-14 Thread Joanne Pham
Thanks Igor, So you prefer #1 instead of #2. Thanks, JP From: Igor Tandetnik To: sqlite-users@sqlite.org Sent: Thursday, May 14, 2009 11:13:23 AM Subject: Re: [sqlite] Should use prepare/bind or just sqlite_exec. Joanne Pham

Re: [sqlite] Unable to call SQLITE_SEQUENCE from adbe air

2009-05-14 Thread Suresh Narasimhan
I do see the table from command line, just that dont see it from Actionscript code thanks Suresh On Thu, May 14, 2009 at 12:05 PM, D. Richard Hipp wrote: > > On May 14, 2009, at 2:58 PM, Suresh Narasimhan wrote: > > > I tried calling select seq from SQLITE_SEQUENCE table from

Re: [sqlite] Unable to call SQLITE_SEQUENCE from adbe air

2009-05-14 Thread D. Richard Hipp
On May 14, 2009, at 2:58 PM, Suresh Narasimhan wrote: > I tried calling select seq from SQLITE_SEQUENCE table from with > actionscript > and i get a Error 3115 no such table detailID :2013 > You have to have an INTEGER PRIMARY KEY AUTOINCREMENT somewhere in your schema or else the

[sqlite] Unable to call SQLITE_SEQUENCE from adbe air

2009-05-14 Thread Suresh Narasimhan
I tried calling select seq from SQLITE_SEQUENCE table from with actionscript and i get a Error 3115 no such table detailID :2013 I know this might be air specific i posted in their forum , but havent got any reply. So thought would post it here to see if people here know about this. thanks,

Re: [sqlite] Should use prepare/bind or just sqlite_exec.

2009-05-14 Thread Igor Tandetnik
Joanne Pham wrote: > I would like to update the database and there are two ways to do it > and I were wondering which way is better: > 1) Way 1 - used the sqlite3_preare, sqlite3_bind , sqlite3_step ... > > 2) Way #2 > q = "UPDATE logTable SET stale = 1 WHERE id = "; >

[sqlite] Should use prepare/bind or just sqlite_exec.

2009-05-14 Thread Joanne Pham
Hi all, I would like to update the database and there are two ways to do it and I were wondering which way is better: 1) Way 1 - used the sqlite3_preare, sqlite3_bind , sqlite3_step ...     q = "UPDATE logTable SET stale = ? WHERE id = ?";      rc = sqlite3_prepare(updateSqli q, -1, , 0);      if

Re: [sqlite] seg fault in sqlite3MemFree

2009-05-14 Thread Dan
On May 14, 2009, at 6:07 AM, Ala Qumsieh wrote: > Hi all, > > I'm using the latest sqlite3 v3.6.14. > > I noticed that when using virtual tables (with the R*TREE extension), > I'm getting sporadic core dumps. After some digging around, I traced > this to the sqlite3MemFree function (during a

Re: [sqlite] SQL logic error or missing database

2009-05-14 Thread Marco Bambini
Thanks a lot for the explanation Igor. -- Marco Bambini On May 14, 2009, at 1:55 PM, Igor Tandetnik wrote: > "Marco Bambini" wrote > in message news:aa7dd05f-4679-43dd-9dd3-2ba6b98af...@sqlabs.net >> I have two threads that are writing 2000 rows each to the same >>

Re: [sqlite] PRAGMA vdbe_trace not working

2009-05-14 Thread Igor Tandetnik
"Maria" wrote in message news:92adf4ae0905140039o5b05785uf5f9ae9a0ece4...@mail.gmail.com > Hi, I'm using SQLite 3.6.13. > Although I turn on vdbe trace(> PRAGMA bdbe_trace=ON;) and type select > statement, it doesn't show any trace. PRAGMA vdbe_trace only works in a debug

Re: [sqlite] SQL logic error or missing database

2009-05-14 Thread Igor Tandetnik
"Marco Bambini" wrote in message news:aa7dd05f-4679-43dd-9dd3-2ba6b98af...@sqlabs.net > I have two threads that are writing 2000 rows each to the same > database at the same time. > I am using sqlite 3.6.13 compiled with SQLITE_THREADSAFE=1. > > Each client executes this code

[sqlite] PRAGMA vdbe_trace not working

2009-05-14 Thread Maria
Hi, I'm using SQLite 3.6.13. Although I turn on vdbe trace(> PRAGMA bdbe_trace=ON;) and type select statement, it doesn't show any trace. Could anyone advise me why it's happening? By the way, 'explain' is working. But I want to see how the stack values change. Thanks so much. Cheers, Maria.

[sqlite] seg fault in sqlite3MemFree

2009-05-14 Thread Ala Qumsieh
Hi all, I'm using the latest sqlite3 v3.6.14. I noticed that when using virtual tables (with the R*TREE extension), I'm getting sporadic core dumps. After some digging around, I traced this to the sqlite3MemFree function (during a call to disconnect): static void sqlite3MemFree(void *pPrior){  

[sqlite] database is locked or is malformed

2009-05-14 Thread s . breitholz
We use QNX 6.3 on a ppc with sqlite as database for our application. As there was a speed problem in older sqlite versions we used the PRAGMA SYNCHRONOUS = OFF command before creating an INSERT and the PRAGMA SYNCHRONOUS = ON afterwards. We used version 3.4.2 for a long time, 2 month ago we

[sqlite] SQL logic error or missing database

2009-05-14 Thread Marco Bambini
I have two threads that are writing 2000 rows each to the same database at the same time. I am using sqlite 3.6.13 compiled with SQLITE_THREADSAFE=1. Each client executes this code (pseudo C code): void write (sqlite3 *db) { int i; for (i=1; i<=2000; i++) { if

Re: [sqlite] Bad UPDATE performance

2009-05-14 Thread Dan
On May 14, 2009, at 2:33 PM, Ofir Neuman wrote: > Dan, > > Before I got your reply I checked it with Pcache1RemoveFromHash() > and it > fixed the problem. > > I will re-check this issue with pCache->nPage-- but I guess that it > will fix > the problem as well. > > Thanks for the help. > >

Re: [sqlite] Bad UPDATE performance

2009-05-14 Thread Ofir Neuman
Dan, Before I got your reply I checked it with Pcache1RemoveFromHash() and it fixed the problem. I will re-check this issue with pCache->nPage-- but I guess that it will fix the problem as well. Thanks for the help. Will this fix be included in the next build? When a new build should be