[sqlite] Read/write loops

2008-02-21 Thread Colin Darcey
Ken, I am not sure how to use this facility, looks like one responds by sending another email. When you write "use transactions", do you mean "BEGIN TRANSACTION" / "COMMIT TRANSACTION". I am using these SQL commands to achieve transaction control. The first write is accepted, but the second

[sqlite] trying to locate older version of SQLite

2008-02-21 Thread Shibu.Narayanan
Hi, I have a website on a shared hosting which has PHP 5 installed on it. I ran a test program and created a SQLite database from it. When I opened the database file, it has as its first line "This file contains an SQLite 2.1 database". I am trying to download the 2.1 version of SQLite from

Re: [sqlite] Read/write loop

2008-02-21 Thread Ken
Colin, You get the sqlite busy when you are trying to write and another connection/process has the database locked. You can help yourself immensely by using transactions. This improves performance and you can begin transactions immediate. So you only need to test for sqlite busy at

[sqlite] Read/write loop

2008-02-21 Thread Colin Darcey
I get an error "database is locked" or "database read only" when attempting to update a table in the database. I have been reading various articles about this but cannot get a definitive answer from the conflicting discussions. Is it possible (on Windows 2000 using SQLite 3_5_6) to be reading

Re: [sqlite] Most widely deployed?

2008-02-21 Thread Kees Nuyt
On Thu, 21 Feb 2008 14:42:30 -0500, you wrote: >> > > Every copy of Firefox 3 contains a copy of SQLite. >> > And Firefox 2 ;) >> >> Really? What is it used for? >I'm not sure what uses it internally, but it's exposed via >mozIStorageService [1], so add-ons can use it as well! And there's an

Re: [sqlite] Most widely deployed?

2008-02-21 Thread Florian Weimer
* Aristotle Pagaltzis: > * Shawn Wilsher <[EMAIL PROTECTED]> [2008-02-21 20:00]: >> > Every copy of Firefox 3 contains a copy of SQLite. >> And Firefox 2 ;) > > Really? What is it used for? It's used to store data used by the client-side URL classifier ("phishing filter").

Re: [sqlite] Unrecognized "Z" UTC time zone signifier

2008-02-21 Thread Aristotle Pagaltzis
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2008-02-21 13:45]: > Ralf Junker <[EMAIL PROTECTED]> wrote: > > SQLite does not recognize "Z" as the zero offset time zone > > specifier. > > If we start accepting any symbolic timezone names, seems like > we would then need to start accepting them all.

Re: [sqlite] Most widely deployed?

2008-02-21 Thread Toby Roworth
Aristotle Pagaltzis wrote: > * Shawn Wilsher <[EMAIL PROTECTED]> [2008-02-21 20:00]: > >>> Every copy of Firefox 3 contains a copy of SQLite. >>> >> And Firefox 2 ;) >> > > Really? What is it used for? > > Regards, > Apparently it's used for storing profile information in Firefox

Re: [sqlite] Most widely deployed?

2008-02-21 Thread Shawn Wilsher
> > > Every copy of Firefox 3 contains a copy of SQLite. > > And Firefox 2 ;) > > Really? What is it used for? I'm not sure what uses it internally, but it's exposed via mozIStorageService [1], so add-ons can use it as well! Cheers, Shawn [1]

Re: [sqlite] Most widely deployed?

2008-02-21 Thread Aristotle Pagaltzis
* Shawn Wilsher <[EMAIL PROTECTED]> [2008-02-21 20:00]: > > Every copy of Firefox 3 contains a copy of SQLite. > And Firefox 2 ;) Really? What is it used for? Regards, -- Aristotle Pagaltzis // ___ sqlite-users mailing list

Re: [sqlite] Most widely deployed?

2008-02-21 Thread Dennis Cote
[EMAIL PROTECTED] wrote: > > I am not privy to the inner workings of Nokia cellphones, but I > believe any non-SQLite databases they are using do not understand > SQL. The other products might still be a database, but they are > not an *SQL* database. > Richard, Perhaps the title of the page

Re: [sqlite] Multiple table SELECT help

2008-02-21 Thread RBKanso
Samuel Neff wrote: > > Try this.. > > SELECT p.name, sum(s.stat1), sum(s.stat2) > FROM stats s JOIN Players p ON p.ID = s.playerID > WHERE s.gameID IN (SELECT gameID FROM games ORDER BY gameID DESC LIMIT 5) > GROUP BY p.playerID > > HTH, > > Sam > This worked! Thanks for your help Sam. P

Re: [sqlite] Most widely deployed?

2008-02-21 Thread drh
Dennis Cote <[EMAIL PROTECTED]> wrote: > > Nokia sold 350 million cell phones last year alone. Each of those phones > probably had some embedded database on them. It may even be SQLite for > all I know, but if it is not, then it substantially increases the number > of non-SQLite database

Re: [sqlite] Most widely deployed?

2008-02-21 Thread Dennis Cote
Aristotle Pagaltzis wrote: > > I think the claim is unassailable. > I think you and most others have missed Tony's point. All he is saying is the claim that the all other database installations can be accurately estimated by using a count of the number of websites on the internet may be

Re: [sqlite] Most widely deployed?

2008-02-21 Thread Shawn Wilsher
> I have five different copies of the SQLite code on this computer > alone, I think. Every Mac has several of them. One of the servers > I deploy to has at least 10 copies of it. Every copy of Firefox 3 > contains a copy of SQLite. And Firefox 2 ;) Cheers, Shawn

Re: [sqlite] Checking that a row exists?

2008-02-21 Thread Dennis Cote
Fin Springs wrote: > > I have been using: > > SELECT NULL FROM sqlite_master WHERE type='table' AND lower(name)=? > > to determine whether a table exists and looking at the number of rows > returned (I'm using sqlite3_get_table through an API). I get one row > back if the table exists and no

Re: [sqlite] Unrecognized "Z" UTC time zone signifier

2008-02-21 Thread Ralf Junker
[EMAIL PROTECTED] wrote: >Ralf Junker <[EMAIL PROTECTED]> wrote: >> SQLite does not recognize "Z" as the zero offset time zone specifier. > >SQLite does not currently accept any timezone specifiers, other >than a hard-coded timezone offset: > > 1981-04-06T14:45:15+01:00 > >If we start

Re: [sqlite] Data Recovery - Unvacumed DB - OS X Address Book

2008-02-21 Thread drh
Joshua Galvez <[EMAIL PROTECTED]> wrote: > Any help would be appreciated. Even as much as, "No, there really is > no way to do this." > No, there really is no way to do this, at least not without some internal knowledge of what kinds of information Apple is storing in the data.syncdb file.

Re: [sqlite] Most widely deployed?

2008-02-21 Thread Aristotle Pagaltzis
* Toby Roworth <[EMAIL PROTECTED]> [2008-02-20 14:35]: > I'm not sure if this was the right place to post this, but it > would be interesting to hear people's thoughts on the matter. I think the claim is unassailable. I have five different copies of the SQLite code on this computer alone, I

Re: [sqlite] Checking that a row exists?

2008-02-21 Thread Fin Springs
> This query returns a boolean result and stops as soon as it has > determined the result > select exists (select * from contacts where contacts_phone_tel glob ?); > HTH > Dennis Cote I have been using: SELECT NULL FROM sqlite_master WHERE type='table' AND lower(name)=? to determine whether

Re: [sqlite] Please test lastest CVS using WinCE

2008-02-21 Thread Fin Springs
> Can somebody with the ability to compile and test for wince > please test check-in [4802] for me. Is there a recommended way to run the tests on CE? I created a VisualStudio project for sqlite3 but ran into some problems: 1) I couldn't see a way to generate sqlite3.h. I ended up using cygwin

Re: [sqlite] Data Recovery - Unvacumed DB - OS X Address Book

2008-02-21 Thread Joshua Galvez
Any help would be appreciated. Even as much as, "No, there really is no way to do this." Josh On Feb 19, 2008, at 7:46 PM, Joshua Galvez wrote: > Twice recently, on different computers I've had clients lose their > OS X Address Book. Alas, they've not had backups. I've been able > to

Re: [sqlite] Checking that a row exists?

2008-02-21 Thread Dennis Cote
Florian Weimer wrote: > > This query stops after the first match: > > SELECT 1 FROM contacts WHERE contacts_phones_tel GLOB ? LIMIT 1 > Yes, but it returns a 1 if it exists and a null result if doesn't. It is usually better to get a 1 or 0, i.e. true or false result for an existence check.

Re: [sqlite] Easy question concerning C++ & sqlite3

2008-02-21 Thread Dennis Cote
vl.pavlov wrote: > hello & thanks 4 reply > > ok, i think i understand, > i would like that you, if not prob., write the whole solution once with > index on words > Here it is again. create table words (word text primary key, number integer); insert or replace into words

Re: [sqlite] Multiple table SELECT help

2008-02-21 Thread P Kishor
On 2/21/08, RBKanso <[EMAIL PROTECTED]> wrote: > > Assume the following table structure: > > http://www.nabble.com/file/p15613178/sbtables.jpg > > I can get overall player stats for ALL games using this select statement: > > SELECT p.name, sum(s.stat1), sum(s.stat2) > FROM stats s JOIN

Re: [sqlite] Multiple table SELECT help

2008-02-21 Thread Samuel Neff
Try this.. SELECT p.name, sum(s.stat1), sum(s.stat2) FROM stats s JOIN Players p ON p.ID = s.playerID WHERE s.gameID IN (SELECT gameID FROM games ORDER BY gameID DESC LIMIT 5) GROUP BY p.playerID HTH, Sam On Thu, Feb 21, 2008 at 10:25 AM, RBKanso <[EMAIL PROTECTED]> wrote: > > Assume the

Re: [sqlite] How to Optimize query

2008-02-21 Thread Dennis Cote
Manoj Marathayil wrote: > Is there a better way > to write this query? > any help is appreciated. > > Query: > SELECT SUM(metric_diff) FROM snapshot_master WHERE snapshot_master.metric_id > = ? AND > snapshot_master.timestamp_id in (select timestamp_id from timestamp_master > where >

[sqlite] Multiple table SELECT help

2008-02-21 Thread RBKanso
Assume the following table structure: http://www.nabble.com/file/p15613178/sbtables.jpg I can get overall player stats for ALL games using this select statement: SELECT p.name, sum(s.stat1), sum(s.stat2) FROM stats s JOIN Players p ON p.ID = s.playerID GROUP BY p.ID And I can get a

Re: [sqlite] Execute PRAGMA max_page_count command

2008-02-21 Thread drh
"Raviv Shasha" <[EMAIL PROTECTED]> wrote: > Although I limit the sqlite database to 32768 (32K), the db file which > retrieved is equal to 470K. > > What regrading the operations sequence ? Is it correct to first > initialize the sqlite database and then to execute the PRAGMA > max_page_count

Re: [sqlite] Execute PRAGMA max_page_count command

2008-02-21 Thread Raviv Shasha
Although I limit the sqlite database to 32768 (32K), the db file which retrieved is equal to 470K. What regrading the operations sequence ? Is it correct to first initialize the sqlite database and then to execute the PRAGMA max_page_count command or not? What can cause this problem? -Raviv.

Re: [sqlite] Execute PRAGMA max_page_count command

2008-02-21 Thread Igor Tandetnik
"Raviv Shasha" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The problem is although I got the zero value (->SQLITE_OK), the sqlite > database wasn't limited to 32768. How do you determine this? Be aware that max_page_count is not persistent, it's a per-connection option. Once

Re: [sqlite] Execute PRAGMA max_page_count command

2008-02-21 Thread Raviv Shasha
Thanks for your question, The problem is although I got the zero value (->SQLITE_OK), the sqlite database wasn't limited to 32768. Should I use the syntax : sqlSt = sqlite3_exec(pDB, "PRAGMA max_page_count=32768", NULL, 0,); Thnaks, Raviv. -Original Message- From: [EMAIL PROTECTED]

Re: [sqlite] Execute PRAGMA max_page_count command

2008-02-21 Thread Igor Tandetnik
"Raviv Shasha" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > sqlSt = sqlite3_exec(pDB, "PRAGMA max_page_count=32768", NULL, 0, > ); > > The sqlite initialization succeeded, but the sqlSt value always > returned as zero. Zero is SQLITE_OK, meaning success. What seems to be the

[sqlite] Execute PRAGMA max_page_count command

2008-02-21 Thread Raviv Shasha
Hi all, I use the sqlite version 3.5.6 and tired to execute a PRAGMA max_page_count command to limit the sqlite database size and received always return value equals to zero. My code is shown as follows: // sqlite database initialization retVal = sqlite3_exec(pDB, sql, callback,

Re: [sqlite] Unrecognized "Z" UTC time zone signifier

2008-02-21 Thread drh
Ralf Junker <[EMAIL PROTECTED]> wrote: > SQLite does not recognize "Z" as the zero offset time zone specifier. SQLite does not currently accept any timezone specifiers, other than a hard-coded timezone offset: 1981-04-06T14:45:15+01:00 If we start accepting any symbolic timezone names,

Re: [sqlite] Index for Primary Key column missing?

2008-02-21 Thread Neville Franks
Jens, Thanks for that. I incorrectly assumed because the index was named xxx_tags it wasn't for the 'tag' column, but related to the table, which is named 'tags'. I had read the content you referred to. Thursday, February 21, 2008, 11:11:19 PM, you wrote: JM> Am 21.02.2008 um 10:30 schrieb

Re: [sqlite] Index for Primary Key column missing?

2008-02-21 Thread Jens Miltner
Am 21.02.2008 um 10:30 schrieb Neville Franks: > I have created a table with a column: tag text primary key > > When I do: > sqlite> .indices tags > sqlite_autoindex_tags_1 > > I only see the one index which I assume is for the ROWID clm. No, this is the index for your 'tag' column as can be

Re: [sqlite] The best way to handle dynamic table creation

2008-02-21 Thread Neville Franks
Simon, Thanks for that. Just shows how new I am at SQL. Thursday, February 21, 2008, 9:01:22 PM, you wrote: SD> See "IF NOT EXISTS" in http://www.sqlite.org/lang_createtable.html SD> Rgds, SD> Simon SD> On 21/02/2008, Neville Franks <[EMAIL PROTECTED]> wrote: >> I need to create tables on the

[sqlite] Unrecognized "Z" UTC time zone signifier

2008-02-21 Thread Ralf Junker
SQLite does not recognize "Z" as the zero offset time zone specifier. "Z" (for 'Zulu time', an alternative name for UTC) is part of the ISO 8601 standard for date and time representations. See http://en.wikipedia.org/wiki/ISO_8601 for details. In this regard, SQLite does not currently follow

Re: [sqlite] Checking that a row exists?

2008-02-21 Thread Florian Weimer
* Gilles Ganault: > Is this the standard way to check that a row exists in PHP/SQLite, or > is there a better syntax? > $query = "SELECT count(*) FROM contacts WHERE contacts_phones_tel GLOB '%s*'; This query stops after the first match: SELECT 1 FROM contacts WHERE contacts_phones_tel GLOB

Re: [sqlite] The best way to handle dynamic table creation

2008-02-21 Thread Simon Davies
See "IF NOT EXISTS" in http://www.sqlite.org/lang_createtable.html Rgds, Simon On 21/02/2008, Neville Franks <[EMAIL PROTECTED]> wrote: > I need to create tables on the fly which will persist across sessions. > These tables may or may not already exist. > > Calling sqlite3_exec( "create table

[sqlite] The best way to handle dynamic table creation

2008-02-21 Thread Neville Franks
I need to create tables on the fly which will persist across sessions. These tables may or may not already exist. Calling sqlite3_exec( "create table ..." ) for a table which already exists returns SQLITE_ERROR, which I assume can be returned for a range of different errors. You can check the

[sqlite] Index for Primary Key column missing?

2008-02-21 Thread Neville Franks
I have created a table with a column: tag text primary key When I do: sqlite> .indices tags sqlite_autoindex_tags_1 I only see the one index which I assume is for the ROWID clm. I have inserted a row into the table, in case that is relevant. My understanding is that a primary key column will

Re: [sqlite] Creating database in RAM

2008-02-21 Thread Eugene Wee
Hi Kirrthana, you can open an in-memory database by using ":memory:" as the filename. Read: http://www.sqlite.org/capi3ref.html#sqlite3_open Regards, Eugene Wee Kirrthana.M wrote: > Hi all, > > I just want to know wheather it is possible to create Sqlite3 database in > RAM,if it is possible

[sqlite] Creating database in RAM

2008-02-21 Thread Kirrthana.M
Hi all, I just want to know wheather it is possible to create Sqlite3 database in RAM,if it is possible how can i do it in my C-program. Thanks in Advance. Regards, Kirrthana The information contained in this electronic message and any attachments to this message are intended for the

Re: [sqlite] Easy question concerning C++ & sqlite3

2008-02-21 Thread vl.pavlov
hello & thanks 4 reply ok, i think i understand, i would like that you, if not prob., write the whole solution once with index on words Igor Tandetnik wrote: > > "vl.pavlov" <[EMAIL PROTECTED]> wrote > in message news:[EMAIL PROTECTED] >> there is expression: >> >> select count(number) from