Re: [sqlite] SQLITE LIMIT clause

2011-10-10 Thread cricketfan
than that, those two queries should be near identical in your > situation. Mind the gaps. > > On 10/07/2011 03:24 PM, cricketfan wrote: >> Any advice would be greatly appreciated. > > ___ > sqlite-users mailing list > sqlite-use

[sqlite] SQLITE LIMIT clause

2011-10-07 Thread cricketfan
I have a table called test and it has about 50 columns ( about 200 bytes of data, all columns combined). I need to browse the entire table periodically. I have a primary key PK1 which basically is a increasing sequence number. SELECT * from test WHERE PK1>100 AND PK1<200; SELECT * from test WH

Re: [sqlite] SQLITE return codes for insert/delete/update/select

2011-05-11 Thread cricketfan
Igor Tandetnik wrote: > > On 5/11/2011 3:52 PM, cricketfan wrote: >> 1. Return code for an UPDATE/DELETE query (ignoring other error >> conditions) >> will be SQLITE_DONE regardless of the fact whether UPDATE succeeded or >> failed. The only way to know whether

[sqlite] SQLITE return codes for insert/delete/update/select

2011-05-11 Thread cricketfan
I dont know if it is just me but I find the return codes for SQL operation quite confusing. I am new to SQLITE, have learnt a few things and wanted to know if going in the correct direction, 1. Return code for an UPDATE/DELETE query (ignoring other error conditions) will be SQLITE_DONE regardless

[sqlite] Question about explain plain

2010-12-17 Thread cricketfan
I have a composite index on queuedb made up of q_id, date,priority(in the same order). I am trying to find out if the index is being used for both the where clause and the order by clause. I have also posted the output for EXPLAIN QUERY PLAN. dbsql> explain select * from queuedb where q_id='59853

Re: [sqlite] Transactions while using prepare and step

2010-12-02 Thread cricketfan
it to get one row at a time. Since I have an index the impact should be minimal. Please let me know if I am wrong. cricketfan wrote: > > Hello I have a basic question and would be glad if someone can answer it. > I understand that if we have "BEGIN TRANSACTION" and "END T

[sqlite] Transactions while using prepare and step

2010-12-02 Thread cricketfan
Hello I have a basic question and would be glad if someone can answer it. I understand that if we have "BEGIN TRANSACTION" and "END TRANSACTION" then the transaction(s) within that block would be committed, number of transactions could be 10,100,1000 or 1. . Otherwise, SQLITE by default co

Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread cricketfan
Drake, It is in serialized mode. Opening another handle did resolve the issue. I am doing inserts in one thread and then if necessary update the same using another thread. Drake Wilson-3 wrote: > > Quoth cricketfan , on 2010-11-30 12:11:52 -0800: >> Drake, I am usi

Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread cricketfan
Drake, I am using SQLITE in threadsafe mode. Transaction inside another transaction isnt that equivalent of nested transactions? Should that be allowed? I have no problem opening another handle but just trying to understand the intricacies, thanks. Drake Wilson-3 wrote: > > Quoth cric

[sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread cricketfan
Hello, I have 2 threads in my program, 1st thread is doing inserts into a table and 2nd thread is trying to update the already inserted columns. 1. I have bundled the 1000 inserts per transaction in 1st thread. 2. When I try to start a transaction in the 2nd thread for my updates (when th

Re: [sqlite] UPDATE during SELECT

2010-11-23 Thread cricketfan
Pavel, What will happen if you had an index on the other_column for the select/update you mentioned below? Is it just that your tree will be unbalanced every time you change the other_column? Could there be any other consequences like unpredictable behavior and such? Thanks > Exactly t

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-08 Thread cricketfan
SQL will not do the trick for me because I based on the select I have to perform other operations(queries on other tables) and only then can I update the table in question. Kees Nuyt wrote: > > There is no need to do this in a loop with a cursor. > Whenever possible, use the power of SQL set ope

Re: [sqlite] EXTERNAL: sqlite3_step to select and update the same table

2010-11-07 Thread cricketfan
I thought call to clear bindings and reset was working but I got confused and am wherever I was before posting on the forum. Still have no conclusive evidence as to why the database in my application is behaving in a weird fashion. Any further input would be appreciated. cricketfan wrote

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-07 Thread cricketfan
> On 7 Nov 2010, at 6:14pm, cricketfan wrote: > I don't understand why you find this surprising. You have two pieces of > program: one is trying to look at something while the other is in the > middle of changing it. They are going to argue about which one can access > those val

Re: [sqlite] EXTERNAL: sqlite3_step to select and update the same table

2010-11-07 Thread cricketfan
Mike I also was not able to reproduce this behavior with a small sample program and am puzzled by this behavior in my main application. What puzzled me is 1. Select has criteria a=?, b=?, c=? (prepare statement) - step through it 2. Get the value of d from database based on the above criteria 3. U

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-07 Thread cricketfan
on this? cricketfan wrote: > > rc = sqlite3_bind_text(stmt, 1, temp, (int)strlen(temp), NULL); > while(sqlite3_step(stmt) == SQLITE_ROW) { > ref = sqlite3_column_int(stmt,3); > delSql = sqlite3_mprintf("UPDATE table1 SET ghi = %d WHERE def = %d > ;&q

[sqlite] sqlite3_step to select and update the same table

2010-11-06 Thread cricketfan
Hello, I am trying to select some columns from a table and use that to update another column in the same table using prepare/step/reset/finalize methods. However, when I use the update statement while stepping it is executing the flow 2 times. In order to clarify, I am pasting some pseudo