Re: [sqlite] String is changing after inserting into database

2008-04-18 Thread Harish Dixit
Yes I am using all these 16 bit method calls. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] fetching and updating in Ruby

2008-04-18 Thread Mike Johnston
Hi, Does anyone on the list use the sqlite3 gem with Ruby? Is this list ok to post sqlite/ruby questions? Many thanks in advance Mike - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Re: [sqlite] logging statements executed by the db

2008-04-18 Thread BareFeet
> You can't create a trigger on a select. Only insert, delete, and > update statements can fire a trigger. True. Though now that you mention it, it would obviously be useful to be able to trigger from a select. >> CREATE TRIGGER log_foo >> INSTEAD OF SELECT ON view_bar >> INSERT INTO

Re: [sqlite] cidr data type

2008-04-18 Thread John Stanton
Christof Meerwald wrote: > Hi, > > does SQLite have anything similar to PostgreSQL's cidr data type (see > http://www.postgresql.org/docs/8.3/interactive/datatype-net-types.html). > > I would be particularly interested in being able to use a "contained in" > operator in selects - in PostgreSQL

[sqlite] Using the SQLITE_OMIT_xxx options

2008-04-18 Thread Richard Klein
In order to reduce SQLite's memory footprint in my embedded application, I want to use the SQLITE_OMIT_xxx options to remove unneeded features from SQLite. Using Cygwin running on Windows, I have successfully down- loaded the canonical sources and autoconfigured the Makefile. The Makefile seems

Re: [sqlite] logging statements executed by the db

2008-04-18 Thread Dennis Cote
P Kishor wrote: > > Ok. Let's translate the above in English (for my sake). > > Keep in mind the following as you answer the above -- I have SQLite > compiled already; I can recompile it. I have an application that I > can't change that is calling SQLite through its own interface. I want > to

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
I'll ask this question. The answer is probably "no," but I'll ask it for the sake of completeness. Suppose I created an in-memory db. I use the attach command to associate an additional in-memory db. Suppose I assign the main db to thread 1 and the associated db to thread 2. Can I share

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread Ken
How about this instead. Read your records, parse and format into some known format by your application. Write the data to disk in a file. Then put a single entry into a sqlite table. specifing the on disk file name. Sqlite may only have one write operation running concurrently. There are

Re: [sqlite] logging statements executed by the db

2008-04-18 Thread P Kishor
On 4/18/08, Dennis Cote <[EMAIL PROTECTED]> wrote: > P Kishor wrote: > > > I have a rather opaque application that is calling my db. Is there > > something I can turn on in SQLite that will log all the statements > > executed against it? > > > > > > You can use sqlite3_trace() to register a

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
On Apr 18, 2008, at 2:33 :32PM, Dennis Cote wrote: > > To share an attached database the threads must be able to name it, and > this is only possible with a file database. you could change the open() function to be able to assign a name to an in-memory db and then keep a mapping of all the

Re: [sqlite] cidr data type

2008-04-18 Thread Nicolas Williams
On Fri, Apr 18, 2008 at 04:34:07PM -0500, Nicolas Williams wrote: > You could have functions to convert to/from display notation, and then > the internal storage format could be an integer, or even as a bit string ^^^ Here I had in mind a 64-bit

Re: [sqlite] logging statements executed by the db

2008-04-18 Thread Dennis Cote
P Kishor wrote: > I have a rather opaque application that is calling my db. Is there > something I can turn on in SQLite that will log all the statements > executed against it? > You can use sqlite3_trace() to register a callback that is passed each SQL statement as it is executed. Your

Re: [sqlite] cidr data type

2008-04-18 Thread Nicolas Williams
On Fri, Apr 18, 2008 at 11:08:24PM +0200, Christof Meerwald wrote: > does SQLite have anything similar to PostgreSQL's cidr data type (see > http://www.postgresql.org/docs/8.3/interactive/datatype-net-types.html). No. > Currently, I am thinking of storing start and end IP addresses as a blob in

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread Dennis Cote
James Gregurich wrote: >> You will have to open the memory database and attach the db file since >> SQLite can't attach to a memory database. > > is this information wrong? > http://www.blitzbasic.com/Community/posts.php?topic=60981 > No it's not. I was mistaken. SQLite can attach a memory

[sqlite] cidr data type

2008-04-18 Thread Christof Meerwald
Hi, does SQLite have anything similar to PostgreSQL's cidr data type (see http://www.postgresql.org/docs/8.3/interactive/datatype-net-types.html). I would be particularly interested in being able to use a "contained in" operator in selects - in PostgreSQL you are able to do: select inet

[sqlite] logging statements executed by the db

2008-04-18 Thread P Kishor
I have a rather opaque application that is calling my db. Is there something I can turn on in SQLite that will log all the statements executed against it? -- Puneet Kishor ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
On Apr 18, 2008, at 1:25 :36PM, Dennis Cote wrote: > James Gregurich wrote: >> >> suppose I create a temporary db file on disk. Each task ( a thread) >> opens a connection to the temp file and attaches an in-memory db to >> it. > > You will have to open the memory database and attach the db file

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread Dennis Cote
James Gregurich wrote: > > suppose I create a temporary db file on disk. Each task ( a thread) > opens a connection to the temp file and attaches an in-memory db to > it. You will have to open the memory database and attach the db file since SQLite can't attach to a memory database. I

Re: [sqlite] speed for select statements

2008-04-18 Thread Kees Nuyt
On Thu, 17 Apr 2008 12:47:52 +0530, Mahalakshmi.m wrote: >MY Table is: > >"CREATE TABLE ARTIST(ArtistId INTEGER PRIMARY KEY,ArtistName TEXT NOT NULL >COLLATE NOCASE, ArtistTrackCount INTEGER, UNIQUE(ArtistName));" > >"CREATE TABLE ALBUM(AlbumId INTEGER PRIMARY KEY,AlbumName TEXT NOT NULL

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
I'm working on a commercial, boxed, desktop product. I can't be creating new mounted disks on a customer's system every time he uses my application. How about this... suppose I create a temporary db file on disk. Each task ( a thread) opens a connection to the temp file and attaches

[sqlite] Trouble opening binaries for Mac

2008-04-18 Thread Carl Gundel
I'm pretty new to Mac development (and Unix) so I'm sure I'm doing something silly, but I cannot seem to extract the contents of the latest binaries for OS X. The file at http://sqlite.org/sqlite3-3_5_8-osx-x86.bin.gz seems to dowload okay. OS X tells me this is a MacBinary archive. I didn't

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread Dennis Cote
James Gregurich wrote: > If the sqlite statement had a temporary storage area so that I could > load up a bunch of rows and then commit them in one shot so that the > lock on the db was not held very long by a single transaction, that > would probably work. > Using a RAM disk you could

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
If the sqlite statement had a temporary storage area so that I could load up a bunch of rows and then commit them in one shot so that the lock on the db was not held very long by a single transaction, that would probably work. However, my reading of the documentation leads me to believe

Re: [sqlite] when we need to use sqlidte3_close

2008-04-18 Thread Dennis Cote
Joanne Pham wrote: > The question that I had is when we need to use the sqlite3_close. > So the question is do we need to use the sqlite3_close and when we need it. sqlite3_close() closes the database connection opened by sqlite3_open(). You use it when you are done with a database connection.

[sqlite] when we need to use sqlidte3_close

2008-04-18 Thread Joanne Pham
Hi All, The question that I had is when we need to use the sqlite3_close. The reason that I have this question because I had the following codes and it crashed if the sqlite3_closed is used. Below is the codes: . sqlSt = sqlite3_prepare_v2(pDb,stmt,-1,,0); if

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread Dennis Cote
James Gregurich wrote: > > I need to set up multiple writers to an in-memory datastore. I just > discovered that you can't have more than one connection to an in- > memory store. > > I can give each task its own independent datastore if there is a way I > can merge the contents of each

[sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
hi! I need to set up multiple writers to an in-memory datastore. I just discovered that you can't have more than one connection to an in- memory store. I can give each task its own independent datastore if there is a way I can merge the contents of each store into a central store. Is there

Re: [sqlite] sqlite3_changes question

2008-04-18 Thread Fin Springs
>> > I don't know for sure, but I suspect it would be the same. It seems > like > it should be simple enough to try it out both ways. > > Dennis Cote It seems too, and the description in the help implies that it does, but I wanted to double check. I have logic that reacts based on that

Re: [sqlite] in memory or hard disk reading?

2008-04-18 Thread Doug
I recall reading that you should set the page size to the cluster size of your disk. I think 4KB clusters are typical on Windows, and the SQLite cluster size is 2KB if I remember correctly, so I bumped that up. I've played around with increasing the cache_size by 2x - 4x and it helps as well,

Re: [sqlite] sqlite3_changes question

2008-04-18 Thread Dennis Cote
Fin Springs wrote: > > A related question: If I do an UPDATE not in an explicit transaction, > it will create an implicit transaction. Is that implicit transaction > the equivalent of wrapping the UPDATE in BEGIN IMMEDIATECOMMIT? > If not, which BEGIN x is it equivalent to? I believe

Re: [sqlite] sqlite3_changes question

2008-04-18 Thread Dennis Cote
Fin Springs wrote: > > My question is, if I changed > the statement in the single exec call to "BEGIN IMMEDIATE;UPDATE > foo...;COMMIT", will sqlite3_changes still return the same value as > before? Or do I need to make the BEGIN/COMMIT in separate exec calls > from the UPDATE to get my

Re: [sqlite] in memory or hard disk reading?

2008-04-18 Thread L B
Thanks Doug. Is there any suggestion or rules about parameters to use (cache_size, default_cache_size...) in relation to database size and number of records in a table? - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Re: [sqlite] in memory or hard disk reading?

2008-04-18 Thread Doug
Someone correct me if I'm wrong, but ... > Could this improvement be different changing operating system? Certainly. You're benefitting from an OS that does file caching. If you switch to an OS with no file caching you'll lose the benefit. > When Is it convenient to use SQLite page-cache

Re: [sqlite] sqlite3_changes question

2008-04-18 Thread Fin Springs
On Apr 17, 2008, at 5:05 PM, Fin Springs 20dkom502-at-sneakemail.com | sqlite| wrote: > If I do: > > sqlite3_exec(..."UPDATE foo..."...) > > and then: > > numChanges = sqlite3_changes() > > I get the number of updated rows back. My question is, if I changed > the statement in the single exec

Re: [sqlite] String is changing after inserting into database

2008-04-18 Thread Doug
Are you using the 16 bit calls? Like: sqlite3_prepare16_v2 sqlite3_column_text16 sqlite3_open16 That's what I use and I'm able to store and retrieve every non-Latin character I've tried so far. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of

Re: [sqlite] in memory or hard disk reading?

2008-04-18 Thread L B
Thanks for your reply. So, as I understand, this performance improvement is due to the operating system, not to sqlite itself. Could this improvement be different changing operating system? When Is it convenient to use SQLite page-cache for large database (example 4 gb) and in which

Re: [sqlite] in memory or hard disk reading?

2008-04-18 Thread Jay A. Kreibich
On Fri, Apr 18, 2008 at 05:46:26AM -0700, L B scratched on the wall: > Hi all, > I have a query that, first time is executed, takes 40 seconds to give > results. > After the first execution, it takes about 15 seconds. > My question is: Is the db loaded into memory? I thought db is > read

Re: [sqlite] how to select uncomitted rows?

2008-04-18 Thread Alex Katebi
Scott, Because of the issues that you have raised I realized that multiple configuration commands rolled into one transaction is not a good idea and is not necessary. The router will act on a single command from any CLI session. As far as command action goes it will be connection less towards

Re: [sqlite] "wrong # of entries in index " occur in MultiThread insert operation

2008-04-18 Thread Luca Olivetti
En/na 彭卫 ha escrit: > I use sqlite in multithread, connect db in each thread(often two thread); > After several times insert, I run PRAGMA integrity_check, display this > message: > "wrong # of entries in index sqlite_autoindex_msglog_1" Did you compile sqlite with "--enable-threadsafe"

[sqlite] "wrong # of entries in index " occur in MultiThread insert operation

2008-04-18 Thread 彭卫
I use sqlite in multithread, connect db in each thread(often two thread); After several times insert, I run PRAGMA integrity_check, display this message: "wrong # of entries in index sqlite_autoindex_msglog_1" Is index not threadsafe? ___

Re: [sqlite] String is changing after inserting into database

2008-04-18 Thread Harish Dixit
Yes. It is UTF-16 encoded On Fri, Apr 18, 2008 at 12:21 PM, Marco Bambini <[EMAIL PROTECTED]> wrote: > Is your database UTF-16 encoded? > > More information at: http://www.sqlite.org/pragma.html > PRAGMA encoding section. > > --- > Marco Bambini > http://www.sqlabs.net >

Re: [sqlite] TlsAlloc

2008-04-18 Thread Vlastimil Miléř
Thanks, I should have checked the latest build first. Sorry for wasting your time. Br, Vlasta On Fri, Apr 18, 2008 at 9:48 AM, Dan <[EMAIL PROTECTED]> wrote: > > > On Apr 18, 2008, at 2:27 PM, Vlastimil Miléř wrote: > > > Hello everybody, > > > > first of all, thanks for this great library!

Re: [sqlite] TlsAlloc

2008-04-18 Thread Dan
On Apr 18, 2008, at 2:27 PM, Vlastimil Miléř wrote: > Hello everybody, > > first of all, thanks for this great library! It works beautifully, but > I have encountered a small problem when running my app in Microsoft > Application Verifier. It reported an unreleased tls slot on dll > unloading

Re: [sqlite] String is changing after inserting into database

2008-04-18 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Harish Dixit wrote: > It seems that the problem is related to the some symbols having ASCII value > between these ranges: That would be unicode code points (ASCII is zero through 127) :-) > 1.56320 - 57343 > 2.55296 - 56319 You will

[sqlite] TlsAlloc

2008-04-18 Thread Vlastimil Miléř
Hello everybody, first of all, thanks for this great library! It works beautifully, but I have encountered a small problem when running my app in Microsoft Application Verifier. It reported an unreleased tls slot on dll unloading and I traced it back to one of sqlite functions. I modified

Re: [sqlite] String is changing after inserting into database

2008-04-18 Thread Marco Bambini
Is your database UTF-16 encoded? More information at: http://www.sqlite.org/pragma.html PRAGMA encoding section. --- Marco Bambini http://www.sqlabs.net http://www.sqlabs.net/blog/ http://www.sqlabs.net/realsqlserver/ On Apr 18, 2008, at 8:37 AM, Harish Dixit wrote: > Hello, > > I am

[sqlite] String is changing after inserting into database

2008-04-18 Thread Harish Dixit
Hello, I am inserting some unicode string into the SQLite database. After inserting, at the time of retrieving value has been modified. For example: I am inserting "즒铭ꓽ菷\큭셙냼誜\꾁霤꿩뱪낌.wma" when i am retrieving it the value is : "馒铭ꓽ菷\큭셙냼誜\꾁霤꿩뱪낌.wma" It seems that the problem is related to