[sqlite] Re: [sqlite] How to configure to reduce the RAM consumption?

2006-07-26 Thread mycmos
--- Sarah <[EMAIL PROTECTED]>写道: > Hi, all > > I'm using SQLite in an embedded device with uc/os-II > OS kernel. > > Due to the extremely limited RAM size, I have to > config the SQLite somehow > to reduce the RAM consumption as much as possible. > > I guess there are some actions I can take,

[sqlite] How to configure to reduce the RAM consumption?

2006-07-26 Thread Sarah
Hi, all I'm using SQLite in an embedded device with uc/os-II OS kernel. Due to the extremely limited RAM size, I have to config the SQLite somehow to reduce the RAM consumption as much as possible. I guess there are some actions I can take, for instance, to disable page cache, to use hard disk(h

[sqlite] memory leak

2006-07-26 Thread mycmos
Hi all, I am using sqlite2.8.17 for linux2.6. My program is as following: int main() { sqlite *db; while(1){ db = sqlite_open("./example.db",0777,0); if(db == 0){ printf("Could not open database."); exit(1); } sleep(2); sqlite_close(db)

Re: [sqlite] temp_store=1 performance on Mac OS X vs. Windows

2006-07-26 Thread Joe Wilson
--- Jens Miltner <[EMAIL PROTECTED]> wrote: > Am 26.07.2006 um 04:16 schrieb Joe Wilson: > > In order to isolate some variables, what results do you get > > with the default ./configure && make on both platforms? > > (default is temp store = file, non-threadsafe). > > We explicitely define the TEM

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Kees Nuyt
On Wed, 26 Jul 2006 16:02:00 -0500, Dennis Jenkins wrote: >[EMAIL PROTECTED] wrote: >> It has been suggested that I add a mutex to every SQLite >> database connection. This would cause access to a database >> connection to automatically serialize even when two or more >> threads try to use that

Re: [sqlite] how to use the sqlite command-line specific commands with the dll version

2006-07-26 Thread John Stanton
John Newby wrote: Hi, I was wondering how I could use the commands specific to the command-line interface with the dll version. The commands I am wanting to use are as follows :- .dump .import .output .read Any help would be greatly appreciated Many thanks John These are part of the Sqlite3

Re: [sqlite] retrieving integers and long

2006-07-26 Thread John Stanton
Wyan wrote: I'm calling sqlite3_column_type() to get the type, and, for a number (20), it returns SQLITE_INTEGER. I'm guessing this covers int, long, and long long. Is there any way to distinguish which one it is, so I can know to call the right sqlite3_column_() function? I've got some

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread John Stanton
Jay Sprenkle wrote: On 7/26/06, John Stanton <[EMAIL PROTECTED]> wrote: > > Almost a "plug-in" serialization organization. I don't think I've ever > seen anyone do it that way, but that might be really valuable. > The embedded software guys would just love it. We had an ISAM product which work

[sqlite] Re: Reading the same table from two threads

2006-07-26 Thread A. Pagaltzis
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2006-07-26 16:40]: > It has been suggested that I add a mutex to every SQLite > database connection. Client code can easily use trivial wrappers to supply such serialisation for itself, though. > The downside is the (minimal) additional overhead of acquiri

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Nathaniel Smith
On Wed, Jul 26, 2006 at 02:32:58PM +, [EMAIL PROTECTED] wrote: > It has been suggested that I add a mutex to every SQLite > database connection. This would cause access to a database > connection to automatically serialize even when two or more > threads try to use that connection at once, thu

Re: [sqlite] Re: retrieving integers and long

2006-07-26 Thread Wyan
Well, obviously, I can always call the int64 function. But, if I have a database library, I want to be able to put the int's in the database into C/C++ int's, and whole numbers that are long's in the database into C/C++ long's. I've worked around it, but it's a little unsafe/strange. On J

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Dennis Jenkins
[EMAIL PROTECTED] wrote: It has been suggested that I add a mutex to every SQLite database connection. This would cause access to a database connection to automatically serialize even when two or more threads try to use that connection at once, thus preventing problems such as the above. The do

Re: [sqlite] temp_store=1 performance on Mac OS X vs. Windows

2006-07-26 Thread Kees Nuyt
On Wed, 26 Jul 2006 20:56:16 +0200, you wrote: >Because sqlite has to deal with so many platforms, it shouldn't >make as few assumptions as possible about the 'correctness' ... Oops, that should of course read: Because sqlite has to deal with so many platforms, it should make as few assumptions a

[sqlite] Re: retrieving integers and long

2006-07-26 Thread Igor Tandetnik
Wyan <[EMAIL PROTECTED]> wrote: On Jul 26, 2006, at 12:39 PM, Jay Sprenkle wrote: On 7/26/06, Wyan <[EMAIL PROTECTED]> wrote: I'm calling sqlite3_column_type() to get the type, and, for a number (20), it returns SQLITE_INTEGER. I'm guessing this covers int, long, and long long. Is there any w

Re: [sqlite] retrieving integers and long

2006-07-26 Thread Wyan
Right. But I want to be able to determine the type. On Jul 26, 2006, at 12:39 PM, Jay Sprenkle wrote: On 7/26/06, Wyan <[EMAIL PROTECTED]> wrote: I'm calling sqlite3_column_type() to get the type, and, for a number (20), it returns SQLITE_INTEGER. I'm guessing this covers int, long, and long

Re: [sqlite] how to use the sqlite command-line specific commands with the dll version

2006-07-26 Thread Nuno Lucas
On 7/26/06, John Newby <[EMAIL PROTECTED]> wrote: Hi, I was wondering how I could use the commands specific to the command-line interface with the dll version. You can't, but see below. The commands I am wanting to use are as follows :- .dump .import .output .read You can look into the she

Re: [sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-26 Thread John Newby
Hi Richard, I noticed 'ADD' and 'COLUMN' aren't allowed but aren't on the list but I haven't came accross any others at the moment. I have taken your advice and am now putting all identifiers between double quotes. Many thanks for your help John On 26/07/06, [EMAIL PROTECTED] <[EMAIL PROTECTED

[sqlite] how to use the sqlite command-line specific commands with the dll version

2006-07-26 Thread John Newby
Hi, I was wondering how I could use the commands specific to the command-line interface with the dll version. The commands I am wanting to use are as follows :- .dump .import .output .read Any help would be greatly appreciated Many thanks John

Re: [sqlite] retrieving integers and long

2006-07-26 Thread Jay Sprenkle
On 7/26/06, Wyan <[EMAIL PROTECTED]> wrote: I'm calling sqlite3_column_type() to get the type, and, for a number (20), it returns SQLITE_INTEGER. I'm guessing this covers int, long, and long long. Is there any way to distinguish which one it is, so I can know to call the right sqlite3_column_()

[sqlite] retrieving integers and long

2006-07-26 Thread Wyan
I'm calling sqlite3_column_type() to get the type, and, for a number (20), it returns SQLITE_INTEGER. I'm guessing this covers int, long, and long long. Is there any way to distinguish which one it is, so I can know to call the right sqlite3_column_() function? I've got some higher level

Re: [sqlite] Re: UTF8

2006-07-26 Thread Cesar David Rodas Maldonado
OK! I understand Igor! Thanks 4 your help! On 7/26/06, Igor Tandetnik <[EMAIL PROTECTED]> wrote: Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: > I wanted to ask how can i know if a given text is UTF8 or ISO-8859-1? You can't really. You need to have some metadata - some means outside

Re: [sqlite] temp_store=1 performance on Mac OS X vs. Windows

2006-07-26 Thread Kees Nuyt
On Tue, 25 Jul 2006 23:13:31 +0200, you wrote: >Hi, > >we just found that when using file-based temporary storage (compile >time macro definition TEMP_STORE=1) vs. memory-based temporary >storage (TEMP_STORE=2), on Mac OS X, the performance almost doesn't >degrade at all, whereas on Windows,

[sqlite] Re: UTF8

2006-07-26 Thread Igor Tandetnik
Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: I wanted to ask how can i know if a given text is UTF8 or ISO-8859-1? You can't really. You need to have some metadata - some means outside the text itself to let you know what encoding the text is in. E.g. a combination of two bytes C3

Re: [sqlite] temp_store=1 performance on Mac OS X vs. Windows

2006-07-26 Thread Kees Nuyt
On Wed, 26 Jul 2006 15:23:04 +0100 (BST), you wrote: >Looking at this reminded me. What is the point of deleting the rollback >log? Why not just truncate it when committing a transaction, and deleting >it only when closing the database? My guess: Because sqlite has to deal with so many platfor

Re: [sqlite] UTF8

2006-07-26 Thread Cesar David Rodas Maldonado
Thanks peter! :D On 7/26/06, Peter Cunderlik <[EMAIL PROTECTED]> wrote: > I wanted to ask how can i know if a given text is UTF8 or ISO-8859-1? If you need conversions, the simplest would be to do it manually using look-up tables. AFAIK none of the Latin-1 characters take more than 2 bytes in

Re: [sqlite] UTF8

2006-07-26 Thread Peter Cunderlik
I wanted to ask how can i know if a given text is UTF8 or ISO-8859-1? If you need conversions, the simplest would be to do it manually using look-up tables. AFAIK none of the Latin-1 characters take more than 2 bytes in UTF-8, so having 2*256 bytes long table won't hurt. If you want to decode s

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
On 7/26/06, John Stanton <[EMAIL PROTECTED]> wrote: > > Almost a "plug-in" serialization organization. I don't think I've ever > seen anyone do it that way, but that might be really valuable. > The embedded software guys would just love it. We had an ISAM product which worked after that fashion.

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread John Stanton
Jay Sprenkle wrote: On 7/26/06, John Stanton <[EMAIL PROTECTED]> wrote: Jay Sprenkle wrote: >> > Will the mutex replace file locking for database access control? >> > >> >> No. A mutex only works within a single process. > > > I was thinking it might make a good compile time option. > If you a

Re: [sqlite] UTF8

2006-07-26 Thread Cesar David Rodas Maldonado
I'm sorry! English is not my first language!! :D I wanted to ask how can i know if a given text is UTF8 or ISO-8859-1? Thanks and please forgive me for my english! :D On 7/26/06, Cory Nelson <[EMAIL PROTECTED]> wrote: ASCII is completely valid UTF-8, so no conversion is necessary. On 7/26/06

Re: [sqlite] UTF8

2006-07-26 Thread Cory Nelson
ASCII is completely valid UTF-8, so no conversion is necessary. On 7/26/06, Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: How can i know if a given text is UTF8 or ascii? and how can i convert between ascii to UTF8? -- Cory Nelson http://www.int64.org

[sqlite] Re: UTF8

2006-07-26 Thread Igor Tandetnik
Cesar David Rodas Maldonado <[EMAIL PROTECTED]> wrote: How can i know if a given text is UTF8 or ascii? and how can i convert between ascii to UTF8? If by ASCII you mean a set of 128 characters representable in 7 bits, then UTF8 is a superset of ASCII. Any ASCII text is also a UTF8 text, and

[sqlite] UTF8

2006-07-26 Thread Cesar David Rodas Maldonado
How can i know if a given text is UTF8 or ascii? and how can i convert between ascii to UTF8?

Re: [sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-26 Thread drh
Dennis Cote <[EMAIL PROTECTED]> wrote: > John Newby wrote: > > > > Is there any other names I need to look out for other than the > > "sqlite_" and > > "table" that SQLite doesn't like as being a table name that anyone > > knows of? > > > John, > > All keywords need to be quoted to use them as i

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
On 7/26/06, John Stanton <[EMAIL PROTECTED]> wrote: Jay Sprenkle wrote: >> > Will the mutex replace file locking for database access control? >> > >> >> No. A mutex only works within a single process. > > > I was thinking it might make a good compile time option. > If you aren't going to access

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread John Stanton
Jay Sprenkle wrote: > Will the mutex replace file locking for database access control? > No. A mutex only works within a single process. I was thinking it might make a good compile time option. If you aren't going to access the database from multiple machines then the mutex could replace fil

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread John Stanton
[EMAIL PROTECTED] wrote: "Rob Richardson" <[EMAIL PROTECTED]> wrote: I found the spot where I was telling the two threads to use the same database pointer instead of running on separate ones. Once I fixed that, it works. It has been suggested that I add a mutex to every SQLite database con

Re: [sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-26 Thread John Newby
Hi Dennis, thanks for this, I've just spent the last 30 mins typing in every word I could think of that might have come up with a conflict, it was nowhere near as big as the list in the link. Thanks for the tips. John On 26/07/06, Dennis Cote <[EMAIL PROTECTED]> wrote: John Newby wrote: > > I

Re: [sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-26 Thread Dennis Cote
John Newby wrote: Is there any other names I need to look out for other than the "sqlite_" and "table" that SQLite doesn't like as being a table name that anyone knows of? John, All keywords need to be quoted to use them as identifiers. There is a comprehensive list of keywords at http://

Re: [sqlite] SQLiteSpy vs. SQLite.dll speed comparison

2006-07-26 Thread John Stanton
Eduardo wrote: At 01:38 26/07/2006, you wrote: Nuno Lucas wrote: On 7/22/06, Eduardo <[EMAIL PROTECTED]> wrote: Sorry, but i must disagree. He uses VC6, a compiler from you use a compiler from pre-altivec era or non altivec optimized libraries (including libc), your code will be a lot slow

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Peter Cunderlik
On 7/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: It has been suggested that I add a mutex to every SQLite database connection. This would cause access to a database connection to automatically serialize even when two or more threads try to use that connection at once, thus preventing pr

Re: [sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-26 Thread John Stanton
John Newby wrote: Hi, I've took the following quote from the SQLite website stating that "Tables names that begin with "*sqlite_*" are reserved for use by the engine" and if you try to create a table beginning with this it lets you know about it, but what about tables called "TABLE", this throws

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Martin Jenkins
Jay Sprenkle wrote: Why are two threads reading the same data? Last != previous? I read it as penultimate vs pre-penultimate data. Martin

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
> Will the mutex replace file locking for database access control? > No. A mutex only works within a single process. I was thinking it might make a good compile time option. If you aren't going to access the database from multiple machines then the mutex could replace file locking as an access

Re: [sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-26 Thread John Newby
Hi Jonathan, yes you are right, thanks for this, I'll just put a check for them all as you never know what a user is going to do its better to try and fix it beforehand. thanks again John On 26/07/06, Jonathan Ballet <[EMAIL PROTECTED]> wrote: John Newby wrote: > Hi Jonathan, Derrel, thanks f

[sqlite] Please un-subscribe

2006-07-26 Thread prabhu kumaravelu
Please un-subscribe from sqlite please me know how to do it. Dont send me email _ Who will win Bollywood’s most coveted IIFA awards? You decide! Cast your vote! http://server1.msn.co.in/sp06/IIFA2006/static/weekend.asp

Re: [sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-26 Thread Jonathan Ballet
John Newby wrote: > Hi Jonathan, Derrel, thanks for the info. > > I just wanted to know as I am creating an application that interacts with > the SQLite.dll and if a user was to try to create a table beginning with > "sqlite_" the user would get the very detailed erro message, but if for > some >

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread drh
"Jay Sprenkle" <[EMAIL PROTECTED]> wrote: > On 7/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > "Rob Richardson" <[EMAIL PROTECTED]> wrote: > > > I found the spot where I was telling the two threads to use the same > > > database pointer instead of running on separate ones. Once I fixed >

Re: [sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-26 Thread John Newby
Hi Jonathan, Derrel, thanks for the info. I just wanted to know as I am creating an application that interacts with the SQLite.dll and if a user was to try to create a table beginning with "sqlite_" the user would get the very detailed erro message, but if for some reason the user wanted to call

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
On 7/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "Rob Richardson" <[EMAIL PROTECTED]> wrote: > I found the spot where I was telling the two threads to use the same > database pointer instead of running on separate ones. Once I fixed > that, it works. > It has been suggested that I add a

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread drh
"Rob Richardson" <[EMAIL PROTECTED]> wrote: > I found the spot where I was telling the two threads to use the same > database pointer instead of running on separate ones. Once I fixed > that, it works. > It has been suggested that I add a mutex to every SQLite database connection. This would ca

RE: [sqlite] Reading the same table from two threads

2006-07-26 Thread Rob Richardson
I found the spot where I was telling the two threads to use the same database pointer instead of running on separate ones. Once I fixed that, it works. Thanks for your help. Rob Richardson Rad-Con, Inc. -Original Message- From: Jay Sprenkle [mailto:[EMAIL PROTECTED] Sent: Wednesday, Ju

Re: [sqlite] temp_store=1 performance on Mac OS X vs. Windows

2006-07-26 Thread Christian Smith
[EMAIL PROTECTED] uttered: Jens Miltner <[EMAIL PROTECTED]> wrote: OTOH, our customers might also have antivirus software installed, so this still would not be a solution :( Does anybody have advice on how to make sqlite work smoothly with antivirus software [on Windows]? (Probably depends on

Re: [sqlite] temp_store=1 performance on Mac OS X vs. Windows

2006-07-26 Thread Jens Miltner
Am 26.07.2006 um 15:41 schrieb [EMAIL PROTECTED]: Jens Miltner <[EMAIL PROTECTED]> wrote: OTOH, our customers might also have antivirus software installed, so this still would not be a solution :( Does anybody have advice on how to make sqlite work smoothly with antivirus software [on Window

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
On 7/26/06, Rob Richardson <[EMAIL PROTECTED]> wrote: Jay, After the first thread, a graph will be displayed and the user can start doing things on it while the next batch of data is being loaded. Ah. "Many readers" should work fine. An access violation sounds like a bad pointer or a compile

RE: [sqlite] unsubscribe me please

2006-07-26 Thread prabhu kumaravelu
unsubscribe me please From: "Shi, Chunde CTR DISA PEO-C2C" <[EMAIL PROTECTED]> Reply-To: sqlite-users@sqlite.org To: Subject: [sqlite] unsubscribe me please RE: [sqlite] sqlite3_interrupt() and threads Date: Tue, 25 Jul 2006 19:17:01 -0400 Chunde Shi [EMAIL PROTECTED] 703 882 1466 703 8

Re: [sqlite] temp_store=1 performance on Mac OS X vs. Windows

2006-07-26 Thread drh
Jens Miltner <[EMAIL PROTECTED]> wrote: >> > OTOH, our customers might also have antivirus software installed, so > this still would not be a solution :( > Does anybody have advice on how to make sqlite work smoothly with > antivirus software [on Windows]? (Probably depends on the antivirus

RE: [sqlite] Reading the same table from two threads

2006-07-26 Thread Rob Richardson
Jay, After the first thread, a graph will be displayed and the user can start doing things on it while the next batch of data is being loaded. Rob -Original Message- From: Jay Sprenkle [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 26, 2006 9:14 AM To: sqlite-users@sqlite.org Subject:

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jens Miltner
Am 26.07.2006 um 14:43 schrieb Rob Richardson: Greetings! I am starting two threads in quick succession that read the same table. Each thread calls sqlite3_open(), so they are using separate database pointers. The first thread asks for records recorded in the last 24 hours. The second t

Re: [sqlite] sqlite3_interrupt() and threads

2006-07-26 Thread Jens Miltner
Am 26.07.2006 um 01:06 schrieb [EMAIL PROTECTED]: Michael Scharf <[EMAIL PROTECTED]> wrote: Rob, I notice in the documentation that the sqlite3_progress_handler() method is marked "experimental". Is that significant? No idea, that's a question Richard Hipp may answer.. I need to remov

Re: [sqlite] SQLiteSpy vs. SQLite.dll speed comparison

2006-07-26 Thread Jay Sprenkle
FYI ACOVEA (Analysis of Compiler Options via Evolutionary Algorithm) implements a genetic algorithm to find the "best" options for compiling programs with the GNU Compiler Collection (GCC) C and C++ compilers. "Best", in this context, is defined as those options that produce the fastest executabl

Re: [sqlite] SQLiteSpy vs. SQLite.dll speed comparison

2006-07-26 Thread Eduardo
At 01:38 26/07/2006, you wrote: Nuno Lucas wrote: On 7/22/06, Eduardo <[EMAIL PROTECTED]> wrote: Sorry, but i must disagree. He uses VC6, a compiler from you use a compiler from pre-altivec era or non altivec optimized libraries (including libc), your code will be a lot slower. While I agre

Re: [sqlite] Reading the same table from two threads

2006-07-26 Thread Jay Sprenkle
On 7/26/06, Rob Richardson <[EMAIL PROTECTED]> wrote: few milliseconds after the first one. I am getting an access violation inside sqlite3.dll when the second thread calls sqlite3_prepare(). Am I trying to do something I shouldn't? Bugs aside, that should work. It doesn't sound like a very e

Re: [sqlite] temp_store=1 performance on Mac OS X vs. Windows

2006-07-26 Thread Jens Miltner
Am 26.07.2006 um 04:16 schrieb Joe Wilson: According to the documentation in http://sqlite.org/pragma.html for PRAGMA temp_store, it seems that only the TEMP_STORE macro values of 0 and 3 unconditionally guarantee temporary storage to be file and memory respectively. Otherwise the runtime "PRAG

[sqlite] Reading the same table from two threads

2006-07-26 Thread Rob Richardson
Greetings! I am starting two threads in quick succession that read the same table. Each thread calls sqlite3_open(), so they are using separate database pointers. The first thread asks for records recorded in the last 24 hours. The second thread asks for records from the same table recorded i

Re: [sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-26 Thread Derrell . Lipman
"John Newby" <[EMAIL PROTECTED]> writes: > Does anyone know any reason why SQLite doesnt like tables called "Table" or > is this a standard SQL thing? It's a reserved word, so if you really, Really, REALLY want to create a table of that name (you're making it confusing to read, so you really shou

Re: [sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-26 Thread Jonathan Ballet
John Newby wrote: > Does anyone know any reason why SQLite doesnt like tables called "Table" or > is this a standard SQL thing? > > Many thanks > > John > I guess that 'Table' is a reserved keyword, part of the SQL language. If you _really_ want to have a table, named 'table', you should put

[sqlite] "SQL Error: near 'Table': Syntax error"

2006-07-26 Thread John Newby
Hi, I've took the following quote from the SQLite website stating that "Tables names that begin with "*sqlite_*" are reserved for use by the engine" and if you try to create a table beginning with this it lets you know about it, but what about tables called "TABLE", this throws back an error stat