Re: [sqlite] Database locked

2004-08-11 Thread Brass Tilde
> > I am trying to import a csv file (ip-to-country to be especific) to a table > > on sqlite db. > > > > Version 2.8: > > COPY FROM '' USING DELIMITERS ','; You weren't a Clipper/XBase programmer at one time, were you? :->

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread D. Richard Hipp
Dave Hayden wrote: I'm running into a deadlock, as the subject says, when doing updates on a table in one thread while another thread is inserting into the same table. (Oh, and this is on 3.0.4, compiled with --enable-threadsafe) The update thread returns from its UPDATE command (within a

Re: [sqlite] Converting 2.8.x database file into 3.x database file

2004-08-11 Thread D. Richard Hipp
[EMAIL PROTECTED] wrote: In the webpage (http://www.sqlite.org/version3.html), it is mentioned that for converting the 2.8.x database file into 3.0 database file, the command line shell is available both in 2.8 and 3.0. I find that the command as mentioned there works with 2.8 executable. But I

Re: [sqlite] Database locked

2004-08-11 Thread D. Richard Hipp
Brass Tilde wrote: Version 2.8: COPY FROM '' USING DELIMITERS ','; You weren't a Clipper/XBase programmer at one time, were you? :-> Never. The COPY command in version 2.8 was taken from PostgreSQL. -- D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565

[sqlite] Row Count

2004-08-11 Thread Drew, Stephen
Hello,   Is there any way to obtain the number of rows returned by a SELECT statement, before receiving all the rows returned?  I am using the sqlite_exec() / sqlite_step() functions to return the data, but need to populate a progress bar.   Regards,Stephen Drew DISCLAIMER: This e-mail and

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread Paolo Vernazza
D. Richard Hipp wrote: Paolo Vernazza wrote: D. Richard Hipp wrote: Dave Hayden wrote: I'm running into a deadlock, db1: BEGIN TRANSACTION; db2: BEGIN TRANSACTION; db1: INSERT INTO test VALUES ( 1 ); At this point, both of these return SQLITE_BUSY: db2: UPDATE test SET num = 2 WHERE num = 1; db1:

Re: [sqlite] Row Count

2004-08-11 Thread Scott Baker
SELECT count(*) FROM Table WHERE Foo = 'bar'; Drew, Stephen wrote: Hello, Is there any way to obtain the number of rows returned by a SELECT statement, before receiving all the rows returned? I am using the sqlite_exec() / sqlite_step() functions to return the data, but need to populate a

Re: [sqlite] SQLite DB synchronization

2004-08-11 Thread John Oliva
I haven't worked out a synchronization scheme yet. One possibility is to model it on how the Palm PDB databases are synchronized. They keep meta-data for each row indicating whether the data is dirty, new, has been deleted, etc. This is optimized for a one-to-one pairing between two databases. A

RE: [sqlite] Row Count

2004-08-11 Thread Drew, Stephen
This will be a big overhead on really small queries I need to be able to say roughly how many rows, but obviously the exact number would be good. Some queries are very time critical and complex so I don't want to have to do a COUNT(*) on them. -Original Message- From: Scott Baker

Re: [sqlite] QNX and PPC

2004-08-11 Thread Jakub Adamek
Still not running on Power PC QNX. I tried to comment out locking in os.c and the test program works fine. So the problem is really hidden in the findLockInfo() & co. functions. Does somebody have some experience? Thanks, Jakub Jakub Adamek wrote: Thank you for your help. I am trying to

[sqlite] SQLite 3 for Pocket PC

2004-08-11 Thread Jakub Adamek
Somebody mentioned here he/she has SQLite 3 working on Pocket PC. Could you please send the sources or diffs? Thanks, Jakub

RE: [sqlite] Row Count

2004-08-11 Thread Drew, Stephen
Yes, I know it sounds a little optimistic :) It's not a problem if I read the whole rowset into memory and then start sending it, but this can cause massive memory usage and time delays. It's not such a big deal if it's not possible, I'll just have to use a Microsoft style progress bar (i.e. one

Re: [sqlite] Row Count

2004-08-11 Thread Derrell . Lipman
"Drew, Stephen" <[EMAIL PROTECTED]> writes: > It's not a problem if I read the whole rowset into memory and then start > sending it, but this can cause massive memory usage and time delays. It's > not such a big deal if it's not possible, I'll just have to use a Microsoft > style progress bar

[sqlite] Views and performances...

2004-08-11 Thread Paolo Vernazza
Hi, I would like to know if using views instead of queries has some performance advantages. If I must perform many times the same query (a select with a complex where clause), is it better to have a precompiled query or to create a view? Thanks Paolo

Re: [sqlite] Database locked

2004-08-11 Thread Felipe Lopes
Thank you!! Was just wondering, does it escape the double quotes around the data?? Thanx again Felipe Lopes Em 11 Aug 2004, [EMAIL PROTECTED] escreveu: >Felipe Lopes wrote: >> >> I am trying to import a csv file (ip-to-country to be especific) to a >table >> on sqlite db. >> >

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread Tito Ciuro
Hello, The point is that when two threads or processes are trying to write at the same time, one of the two must back off, abandon their transaction (using ROLLBACK) and let the other proceed. And how can this be done? What if there are more threads involved? Who decides? -- Tito On Aug 11,

Re: [sqlite] Row Count

2004-08-11 Thread tezozomoc
BlankConsider doing a SELECT COUNT (*) FROM db WHERE etc This should give you the number of rows before you... do the select again... Use where to match the condition. Tezo. - Original Message - From: Drew, Stephen To: '[EMAIL PROTECTED]' Sent: Wednesday, August

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread Richard Boulton
> > The point is that when two threads or > > processes are trying to write at the same time, one of the two > > must back off, abandon their transaction (using ROLLBACK) and let > > the other proceed. > > And how can this be done? What if there are more threads involved? Who > decides? > I found

Re: [sqlite] SQLite DB synchronization

2004-08-11 Thread John LeSueur
John Oliva wrote: I haven't worked out a synchronization scheme yet. One possibility is to model it on how the Palm PDB databases are synchronized. They keep meta-data for each row indicating whether the data is dirty, new, has been deleted, etc. This is optimized for a one-to-one pairing between

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread Michael Roth
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paolo Vernazza wrote: | But doing in that way, you can have this behaviour (and this is what | happends to me): | | db1: BEGIN TRANSACTION;-> SQLITE_OK | db2: BEGIN TRANSACTION;-> SQLITE_OK | | db1: INSERT INTO test VALUES ( 1 );->

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread Dave Hayden
On Aug 11, 2004, at 6:49 AM, D. Richard Hipp wrote: Oops. The db1 should do a ROLLBACK, not a COMMIT. Or db2 can do an END TRANSACTION (since it never made any changes) and allow db1 to complete instead. The point is that when two threads or processes are trying to write at the same time, one

Re: [sqlite] typeless / bug or feature??

2004-08-11 Thread Will Leshner
yesso wrote: hi, sqlite is typeless. OK! but how can i save dates in sqlite because i need dates in my query...?? As long as you store your dates in proper SQL format you should have no trouble querying for them.

Re[2]: [sqlite] full text search working from CD ROM ( Steve O'Hara's solution )

2004-08-11 Thread Matt Sergeant
On Thu, 12 Aug 2004, Pavel wrote: > MS> There are some modules on CPAN which provide generic full text search > MS> backed on any RDBMS. Try http://search.cpan.org/ > > CPAN was my first search, only was I found was DBIx::FullTextSearch > that require MySQL and DBIx::TextIndex that search in

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread tezozomoc
I have solved this problem by writing a wrappers around sql_exec and sql_query, sql_step, etc... In these wrappers I handle the waiting for busy and the lock file issue... It is not elegant but it allowed me to preserve the interface the same way without having to do it at the application level.

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread Dave Hayden
On Aug 11, 2004, at 4:05 PM, tezozomoc wrote: I have solved this problem by writing a wrappers around sql_exec and sql_query, sql_step, etc... In these wrappers I handle the waiting for busy and the lock file issue... I was doing the same, calling usleep() whenever I got a SQLITE_BUSY return and

Re: [sqlite] typeless / bug or feature??

2004-08-11 Thread Paolo Vernazza
how can i realise that, i think its not a good idea to save dates in this format 20041030 (it means the year 2004, month 10 and 30th day) to solve my problem--- Why do you think that? It is really simple to read, write & compare what's the matter? for example i have many rows with each one

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread Paolo Vernazza
For now, I've solved the problem by adding my own locks to exclude simultaneous transactions on the same database file. Ok, but this works only if your app is the only one that can access the DB. If some other app tries to access the same DB you can go in the usual deadlock. Paolo

Re: [sqlite] typeless / bug or feature??

2004-08-11 Thread Kurt Welgehausen
> sqlite is typeless. OK! > >but how can i save dates in sqlite ... describes ALL the date/time functionality of SQLite. You can store dates as strings or numbers; it's your decision. Regards

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread tezozomoc
Good point... I have several different tasks(vxworks) Perhaps, this is why its working well for me... Tezo. - Original Message - From: "Dave Hayden" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 11, 2004 4:30 PM Subject: Re: [sqlite] Deadlock when doing

[sqlite] Query maximum JOIN

2004-08-11 Thread Simon Berthiaume
Hi, I would like to know if there is any maximum to the number of JOIN (LEFT JOIN actualy) I can put in a query. I tried to make a query with 31-32 JOIN and the engine returned no row, but returned no error message either so I don't know. Just a single JOIN before, the query was still returning

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread Tito Ciuro
I'm definitely not happy about this... Let me get this right... it seems that you're cruising along fine with SQLITE_OK's all over the place when suddenly one of your threads/processes get a SQLITE_BUSY signal in the middle of a transaction. In order to solve the crisis, one of the transactions

Re: [sqlite] Deadlock when doing threaded updates and inserts

2004-08-11 Thread dave
On Aug 11, 2004, at 3:48 PM, Dave Hayden wrote: Since only one of the competing threads will have completed a write (right?), can't the others "postpone" their transactions somehow until they can get a write lock? That is, postpone the "begin transaction" action. Since they haven't really done