[sqlite] sqlite multithreading

2005-02-07 Thread Yogesh Marwaha
Hi!

Problem: 1
-
I need some help using sqlite3 with multithreading.
Here is an overview of present situation: -

I am using sqlite 3.0.8

I have two threads (A  B) working at the same time.
Thread A is used to query database while thread B is
being used for writing to the database. Everything
works right if only thread B is running. But when
thread A runs while thread B is still running an error
occurs. The error is: #8220;library routine called
out of sequence#8221;. But this error is not emitted
always, 1 out of 3 times this operation completes
successfully. No action is can be preformed on the
database when the error occurs. It even not closes the
database.

Both threads are using same sqlite connection.

I am using sources from sqlite-source-3_0_8.zip
compiled (with #8211;DTHREADSAFE=1) as a sub-project
inside my own project using kdevelop.


(In the mean time I have come across the following in
sqlite mailing list archive: -
it could be the case that the same database connection
is being used simultaneously by two or more threads.

But I have seen some applications do this successfully
with a single connection.
)


Problem: 2
-
I need some tips on how can I use sqlite inside my
project using kdevelop (i.e. without using
sqlite-source-3_0_8.zip).


Thanks in advance


Yogesh M



Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony


[sqlite] Problem creating TRIGGER

2005-01-14 Thread Yogesh Marwaha
Hi!


I am very new to sqlite. I am having problem creating a trigger. Here is the 
statement: -

sqlite CREATE TRIGGER dat.on_master_insert INSERT ON dat.master_table FOR EACH 
ROW BEGIN INSERT INTO dat.url_stats(new.file_name, '0', '0', '1'); END;
SQL error: near .: syntax error

The problem is near new.file_name, as when I access the database through a C++ 
program while using master_table instead of dat.master_table, same error is 
emitted.

What the statement intends to do is to insrt a record in url_stats table 
whenever a new row is added to master_table.


I am using sqlite 3.0.8.


Thanks in advance

Yogesh M
Chandigarh, India
http://mylinuxapps.tripod.com

[sqlite] Problem creating TRIGGER

2005-01-14 Thread Yogesh Marwaha
Hi!


I am very new to sqlite. I am having problem creating a trigger. Here is the 
statement: -

sqlite CREATE TRIGGER dat.on_master_insert INSERT ON dat.master_table FOR EACH 
ROW BEGIN INSERT INTO dat.url_stats(new.file_name, '0', '0', '1'); END;
SQL error: near .: syntax error

The problem is near new.file_name, as when I access the database through a C++ 
program while using master_table instead of dat.master_table, same error is 
emitted.

What the statement intends to do is to insert a record in url_stats table 
whenever a new row is added to master_table.


I am using sqlite 3.0.8.


Thanks in advance

Yogesh M
Chandigarh, India
http://mylinuxapps.tripod.com

[sqlite] A problem with the select statement

2004-09-25 Thread Yogesh Marwaha
Hi!

I am using sqlite 3.05 beta. I have created a table containing a field named 'title'. 
When I run the SQL Command : -

select count(*) from master_table where title = title 

output is 885, i.e. count of all the rows in the table, whereas it should have 
returned the number of rows in which value of the field title is title (which is 
actually 10). Perhaps sqlite is comparing value of column named title with the column 
itself.

Can somebody please help, 

Yogesh M
Chandigarh, India
http://mylinuxapps.tripod.com