[sqlite] Article on common errors in SQL queries

2006-06-06 Thread Arjen Markus
Hello, I came across the article below and thought this might interest at least some people on this list. Regards, Arjen -- Title: Semantic errors in SQL queries: A quite complete list Authors: Brass, S; Goldberg, C Source: JOURNAL OF SYSTEMS AND

Re: [sqlite] Multithreading. Again.

2006-06-06 Thread drh
Joe Wilson [EMAIL PROTECTED] wrote: Let's assume that for a given OS that fcntl() file locks work perfectly well on any thread. Would it then be safe from an SQLite perspective to finalize statements that were prepared in one thread in a different thread? (where the sqlite connection would

[sqlite] DB from txt file

2006-06-06 Thread Bob Wright
I am a new user of sqlite and have the following question. I have a name,address.phone directory on paper and would like to transfer it to a DB. Would this be possible without me retyping the entire list with 'INSERT INTO' for each entry.? I would scan the list into a text file. Bob Wright

Re: [sqlite] DB from txt file

2006-06-06 Thread Jay Sprenkle
On 6/6/06, Bob Wright [EMAIL PROTECTED] wrote: I am a new user of sqlite and have the following question. I have a name,address.phone directory on paper and would like to transfer it to a DB. Would this be possible without me retyping the entire list with 'INSERT INTO' for each entry.? I would

Re: [sqlite] Memory DB: Load from file

2006-06-06 Thread Dennis Cote
Dave Gierok wrote: Thank you for the help Andrew and D. Richard Hipp. But how would I do this (page 24 25 of the slides) using the C/C++ interface? { sqlite3* pFileDB; sqlite3* pMemoryDB; sqlite3_open(fileName, pFileDB); sqlite3_open(:memory:, pMemoryDB);

RE: [sqlite] Memory DB: Load from file

2006-06-06 Thread Pat Wibbeler
This sounded fun, so I thought I'd give it a try. Here's a sample pulling schema and data from an on-disk to an in-memory database in c. I've omitted error handling and debug output to make it shorter. int process_ddl_row(void * pData, int nColumns, char **values, char **columns); int

[sqlite] multithreading!!!

2006-06-06 Thread Cesar David Rodas Maldonado
Please i beg to every one some one can give me some link or a little of theory of how can i do for write at same time in a database like the others databases??? please i want to do that..

[sqlite] Re: multithreading!!!

2006-06-06 Thread Igor Tandetnik
Cesar David Rodas Maldonado [EMAIL PROTECTED] wrote: some one can give me some link or a little of theory of how can i do for write at same time in a database like the others databases??? With SQLite, you simply can't. The whole database is protected by many-readers-single-writer lock, only

[sqlite] Problems with multiple threads?

2006-06-06 Thread Jiri Hajek
Hello, I'm trying to use SQLite in an application where it's needed to work with one database in mutliple threads. Based on all the info I read in SQLite documentation I create a new database connection for every new thread created. Each thread does some SELECTs, INSERTs or UPDATEs, but there

Re: [sqlite] Problems with multiple threads?

2006-06-06 Thread Bill KING
Jiri Hajek wrote: Hello, I'm trying to use SQLite in an application where it's needed to work with one database in mutliple threads. Based on all the info I read in SQLite documentation I create a new database connection for every new thread created. Each thread does some SELECTs, INSERTs or

Re: [sqlite] multithreading!!!

2006-06-06 Thread John Stanton
Cesar, if you have an embedded application use Sqlite, it is perfect for the job. If you want to deploy an enterprise database with concurrent users use PostgreSQL, Mysql, Sql Server etc. Use Sqlite as you would use a single disk file. Cesar David Rodas Maldonado wrote: Please i beg to

Re: [sqlite] Problems with multiple threads?

2006-06-06 Thread John Stanton
Synchronize you database access so that only one transaction is current and is finalized on cpmpletion. In other words serialize it. You can use a mutex or similar to achieve synchronization. Look back at the recent discussion on this forum. Jiri Hajek wrote: Hello, I'm trying to use

Re: [sqlite] Problems with multiple threads?

2006-06-06 Thread Derrell . Lipman
Jiri Hajek [EMAIL PROTECTED] writes: 1. Occasionally after running Sqlite3_step() I get SQLITE_CANTOPEN ('Unable to open the database file') error. I found out that it can be fixed by running the query again, i.e. again calling Sqlite3_Prepare(). So this isn't a big issue, but still I wonder

Re: [sqlite] Problems with multiple threads?

2006-06-06 Thread Bill KING
[EMAIL PROTECTED] wrote: Jiri Hajek [EMAIL PROTECTED] writes: 1. Occasionally after running Sqlite3_step() I get SQLITE_CANTOPEN ('Unable to open the database file') error. I found out that it can be fixed by running the query again, i.e. again calling Sqlite3_Prepare(). So this isn't a

Re: [sqlite] Problems with multiple threads?

2006-06-06 Thread drh
Jiri Hajek [EMAIL PROTECTED] wrote: 1. Occasionally after running Sqlite3_step() I get SQLITE_CANTOPEN ('Unable to open the database file') error. I found out that it can be fixed by running the query again, i.e. again calling Sqlite3_Prepare(). So this isn't a big issue, but still I wonder

Re: [sqlite] Problems with multiple threads?

2006-06-06 Thread Bill KING
[EMAIL PROTECTED] wrote: Jiri Hajek [EMAIL PROTECTED] wrote: 1. Occasionally after running Sqlite3_step() I get SQLITE_CANTOPEN ('Unable to open the database file') error. I found out that it can be fixed by running the query again, i.e. again calling Sqlite3_Prepare(). So this isn't a

Re: [sqlite] Problems with multiple threads?

2006-06-06 Thread drh
Bill KING [EMAIL PROTECTED] wrote: Could this be cause by one thread opening a transaction, then a second on a second connection trying to open a transaction on it, and failing to open the transaction file (as it already exists?). No. Each database connection (each sqlite3* pointer) has a

Re: [sqlite] Problems with multiple threads?

2006-06-06 Thread Joe Wilson
Hi Bill, When you say handle read/write locking [your]self do you mean outside of SQLite in your code or by altering SQLite's source code? What algorithm do you employ? --- Bill KING [EMAIL PROTECTED] wrote: I personally did do all this, this doesn't solve the issue. As I mentioned earlier,

Re: [sqlite] Problems with multiple threads?

2006-06-06 Thread John Stanton
[EMAIL PROTECTED] wrote: Bill KING [EMAIL PROTECTED] wrote: Could this be cause by one thread opening a transaction, then a second on a second connection trying to open a transaction on it, and failing to open the transaction file (as it already exists?). No. Each database connection

Re: [sqlite] Problems with multiple threads?

2006-06-06 Thread Bill KING
Joe Wilson wrote: Hi Bill, When you say handle read/write locking [your]self do you mean outside of SQLite in your code or by altering SQLite's source code? What algorithm do you employ? --- Bill KING [EMAIL PROTECTED] wrote: I personally did do all this, this doesn't solve the

Re: [sqlite] Problems with multiple threads?

2006-06-06 Thread Bill KING
Joe Wilson wrote: --- Bill KING [EMAIL PROTECTED] wrote: Outside of, and I use Qt's QReadWriteLock. -lockForRead()/lockForWrite() http://doc.trolltech.com/4.1/qreadwritelock.html Thanks. Many follow-up questions... :-) Is this for an application or for the Qt SQLite database

RE: [sqlite] Problems with multiple threads?

2006-06-06 Thread Pat Wibbeler
One means of troubleshooting this is to emit a log statement that includes the thread id with every BEGIN/COMMIT (e.g. printf(%d - %s, thread, sql)). It may be useful to log other sql statements this way as well. This sort of troubleshooting has always shown the mistake to be mine, not SQLite

Re: [sqlite] Large DB Performance Questions

2006-06-06 Thread David Wollmann
Mark Drago wrote: Hello, I'm writing a web cache and I want to use SQLite to store the log of all of the accesses made through the web cache. The idea is to install this web cache in large institutions (1000-5000 workstations). The log database can grow in size very quickly and can reach