Re: [sqlite] Do all db's in a connection need same level of lock?

2009-01-29 Thread Dan
; makes sense when all the files are being changed, but I have a use > case > where I am only modifying one of the attached databases and would > like to > leave the main database unlocked. That should happen automatically. You can use "PRAGMA lock_status" to query the l

Re: [sqlite] Do all db's in a connection need same level of lock?

2009-01-29 Thread Dan
temp|closed def|exclusive sqlite> commit; sqlite> begin exclusive; sqlite> pragma lock_status; main|exclusive temp|closed def|exclusive sqlite> commit; Dan. On Jan 30, 2009, at 1:54 AM, Chris Eich wrote: > I can't get it this (undocumen

Re: [sqlite] Foreign key support

2009-01-30 Thread Dan
On Jan 31, 2009, at 12:25 AM, Adam DeVita wrote: > Good day, > > If I write into the sqlite3 using the analyzer: > > create table mysns (SN int primary key, desc text); > insert into mysns (SN, desc) values (1,2); > create table t2 (mynum int, desc2 text, SN references mysns(SN) ); > > insert int

Re: [sqlite] checking database file

2009-02-01 Thread Dan
On Feb 2, 2009, at 2:34 PM, Zaphod wrote: > Hi All, > > Let's say every time before my system starts to run, i would like to > check the > database for any kind of errors/mistakes. > Is there any API or utility for such purpose? See "PRAGMA integrity_check" here: http://www.sqlite.org/prag

Re: [sqlite] journal_mode = off crash in 3.6.10

2009-02-04 Thread Dan
I think this may be a new one. See here: http://www.sqlite.org/cvstrac/tktview?tn=3636 Dan. On Feb 4, 2009, at 4:27 PM, Vivien Malerba wrote: > This has already been fixed, see > http://www.sqlite.org/cvstrac/tktview?tn=3603 > > Regards, > > Vivien > > 2009/2/4 Br

Re: [sqlite] Saving and loading SQLite pages from a buffer

2009-02-07 Thread Dan
online backup code commentary > about only 1k pages... Yes. The backup code should work with all page sizes. There is some example code up on the draft website now. This is meant to complement the existing API documentation. http://www.sqlite.org/draft/

Re: [sqlite] Insertion and Updation using sqlite3_prepare()

2009-02-07 Thread Dan
mmatically and set the permissions on the file to > allow write > access. This did resolve my problem. Could be a bug. Operating system? Exactly how do we set the permissions on the database file to cause the problem? Dan. > Regards, > -Tom > > On Thu, Feb 5, 2009 at 4:42 A

Re: [sqlite] Error code 21 ( SQLITE_MISUSE ) when binding variables

2009-02-11 Thread Dan
> > * Loop through values, calling sqlite3_bind_text on each of then: > rc = sqlite3_bind_text( my_db_stuff->stmt, my_db_stuff- > >current_position > + 1, local_buff, len, SQLITE_STATIC ); > > On the 1st call to the above, I get the return code 21, which I assume > is 'SQLITE_MISUSE' from searchi

Re: [sqlite] sqlite3_finalize (pStmt=0x28) at ../src/vdbeapi.c:204

2009-02-12 Thread Dan
On Feb 13, 2009, at 11:49 AM, Joanne Pham wrote: > Hi All, > We have an application is used SQLite 3.5.9 and our program is > crashed on > "sqlite3_finalize (pStmt=0x28) at ../src/vdbeapi.c:204" and I don't > know why it crashed on this line. > Do you have any information about why it is cras

Re: [sqlite] sqlite3_finalize (pStmt=0x28) at ../src/vdbeapi.c:204

2009-02-13 Thread Dan
_______ > From: Dan > To: General Discussion of SQLite Database > Sent: Thursday, February 12, 2009 9:03:12 PM > Subject: Re: [sqlite] sqlite3_finalize (pStmt=0x28) at ../src/ > vdbeapi.c:204 > > > On Feb 13, 2009, at 11:49 AM, Joanne Pham wrote: >

Re: [sqlite] Little SQL help please..

2009-02-17 Thread Dan
On Feb 18, 2009, at 1:27 AM, johnny depp (really!) wrote: > > I didn't run it yet, the idea of using min(col1) = max(col1) was all I > needed. > I assumed it was incorrect because I thought > referring to an ungrouped column in a group by was incorrect, > because the > ungrouped col would repre

Re: [sqlite] turning off index during insert?

2009-02-20 Thread Dan
will help with re-index speed. These are both good suggestions and should help. But it is not literally true that indexes are not updated during a transaction. Dan. > It is possible you could just do this from sqlite3 by attaching both > DBs and running something like: > > INSERT I

Re: [sqlite] Attached database atomic-ness

2009-02-20 Thread Dan
nsidered a safe thing to do (whereas a multi-file transaction where the main database is in-memory is not). Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Is there any way to avoid cache invalidation between transactions?

2009-02-22 Thread Dan
ust be invalidated. Otherwise, the cache contents may be retained and used by the next transaction. So in your situation you probably have nothing to worry about. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite caching

2009-02-23 Thread Dan
d and subsequent runs retrieve data from the OS cache. Much faster. Dan. > Regards, > Manohar.S > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___

Re: [sqlite] SAVEPOINT : Seems don't work

2009-02-23 Thread Dan
did the SAVEPOINT command malfunction? Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SAVEPOINT : Seems don't work

2009-02-24 Thread Dan
On Feb 25, 2009, at 2:31 AM, REPKA_Maxime_NeufBox wrote: > I try for test as follow : > > on DOS : sqlite3.exe Database > > then type : SAVEPOINT spoint; > Error message is : 'SQL error :near "savepoint": syntax error' Probably you need to upgrade. S

Re: [sqlite] View - What happens internally

2009-02-28 Thread Dan
QL compiler (the thing that runs when you call sqlite3_prepare_v2()) converts the select statement to "SELECT * FROM (SELECT * FROM t1)" before compiling a prepared statement to implement the query. So adding a view doesn't require a

Re: [sqlite] Sqlite write ( HELP )

2009-03-02 Thread Dan
On Mar 2, 2009, at 1:12 PM, Rajesh Nair wrote: > Hi all > > When I use INSERT INTO stmt how fast sqlite writes it in to the > database. Is it depends up on the OS. Will the record be written to > the database on returning from the exec of INSERT stmt? Results should be in the db when the transac

Re: [sqlite] Bug in SQLITE? "Joins + Order By" Changing row count!?!

2009-03-03 Thread Dan
? Thanks, Dan. > 1. SELECT * FROM tableA a INNER JOIN tableB b INNER JOIN tableC c > INNER > JOIN tableD d LEFT JOIN tableE ON a.b_id = b.id AND a.c_id = c.id > AND > a.d_id = d.id AND c.e_id = e.id; > 2. > 3. CREATE TABLE tableA ( > 4. id

Re: [sqlite] Bug in SQLITE? "Joins + Order By" Changing row count!?!

2009-03-04 Thread Dan
o fix it. But it's much more difficult to figure out if it is still present or not without a database to run your queries against. Thanks, Dan. On Mar 4, 2009, at 9:17 PM, Jonathon wrote: > Thanks Dan for the reply, > > How would I go about creating a sql dump? > > As f

Re: [sqlite] sqlite3 datbase disk image malformed

2009-03-04 Thread Dan
econd process to conclude that the database is valid when there is really a hot-journal file that requires rollback in the file-system. If there are multiple clients all trying to access the database at once then a few operations might return SQLITE_BUSY, but eventually one of the clients will succ

Re: [sqlite] Foreign key support

2009-03-04 Thread Dan
vs: http://www.sqlite.org/cvstrac/getfile?f=sqlite/src/shell.c&v=1.205 Compile it with the amalgamation source: gcc -O2 sqlite3.c shell.c -o sqlite3 Or you could get the full 3.6.11 tarball and compile the standalone version of genfkey it includes: http://www.sqlite.org/sqlite-3.6.

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-05 Thread Dan
3_step(hs); if( (rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED) ) { Sleep(SQLTM_TIME); n++; } }while( (n < SQLTM_COUNT) && ((rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED))); If sqlite3_step() returns SQLITE_BUSY or SQLITE_LOCKED, you need to re

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-05 Thread Dan
On Mar 5, 2009, at 11:14 PM, Marcus Grimm wrote: > Hi Dan, > > thank you! > > Yes! I was not aware that it is wrong to redo a step > when it previously returned the LOCKED state. > That was the reason for the (correct) MISSUSE return on > the 2nd attempt. > > I thi

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-05 Thread Dan
On Mar 6, 2009, at 12:22 AM, Marcus Grimm wrote: > Dan, > > I'm not sure what you mean by technically the SQLITE_BUSY is > also wrong. In the test program I get the SQLITE_BUSY quite > often and by retrying the sqlite3_step() it will sooner or > later succeed. Huh. My m

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-05 Thread Dan
On Mar 6, 2009, at 2:53 AM, Hynes, Tom wrote: > Dan, > > I am a little confused now about how to treat a SQLITE_LOCKED > error. Is this to be treated the same as SQLITE_BUSY (i.e. can > retry, unless an explicit transaction is in effect and the statement > is not a COM

Re: [sqlite] shared cache and SQLITE_MISUSE on sqlite3_step()

2009-03-05 Thread Dan
ng list... :-) The website could be much improved by including examples. Feel free to create a wiki page or two if you have any ideas for them. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Thread-safety and sqlite3_stmt objects

2009-03-06 Thread Dan
they are not threadsafe objects". Why do you want to use a single sqlite3_stmt* from multiple threads at the same time? Dan. > Could someone please clarify this (and maybe add some documentation)? > > Cheers, > > Shawn Wilsher > Mozilla Developer > _

Re: [sqlite] compilation : undefined symbols.

2009-03-10 Thread Dan
parse.c is generated by a program called lemon. You need to pass the same -DSQLITE_OMIT_XXXC options to lemon when it generates parse.c as you do to the C compiler. Dan. On Mar 11, 2009, at 10:42 AM, Mayura S. wrote: > Hello Sir, > > I downloaded sqlite 3.6.11 code for my proj

Re: [sqlite] How to interrupt a running query in SQLite?

2009-03-12 Thread Dan
lite3_interrupt() API: http://www.sqlite.org/c3ref/interrupt.html Dan. > Regards, > Manohar > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-

Re: [sqlite] sqlite3_extended_result_codes() return value

2009-03-12 Thread Dan
top of their head, I'll do some code spelunking. I'm not sure what it means. Right now it always returns SQLITE_OK. Dan. > > > http://sqlite.org/c3ref/extended_result_codes.html > > RW > > --Tyco Electronics-- > Ron Wilson, S/W Systems

Re: [sqlite] How to interrupt a running query in SQLite?

2009-03-13 Thread Dan
tion returns SQLITE_ERROR? What does sqlite3_errcode() return? Dan. > > > I am testing with SQLite 3.6.11. > > Regards, > Manohar.S > > On Thu, Mar 12, 2009 at 4:10 PM, Dan wrote: > >> >> On Mar 12, 2009, at 4:54 PM, manohar s wrote: >> >>> H

Re: [sqlite] WHERE clause doesn't seem to work right

2009-03-13 Thread Dan
"1". Exactly when affinities are applied is described in section 3 of the datatype3.html document. Check out the examples in datatype3.html. They should make everything clear. Dan. > -- > View this message in context: > http://www.nabble.com/WHERE-claus

Re: [sqlite] Compiling 3.6.11 on Solaris results in runtime segmentation fault

2009-03-13 Thread Dan
91c prereqRight is an unsigned 64-bit integer. But aligned to a 4-byte boundary, not an 8-byte one. I guess that's a problem. Could be similar to this one: http://www.sqlite.org/cvstrac/tktview/tn=3553 Is this a 32-bit build? Can you post a ticket for this crash? It's not going

Re: [sqlite] problems with shared cache?

2009-03-19 Thread Dan
On Mar 20, 2009, at 8:10 AM, Damien Elmes wrote: > Unfortunately, a user has just reported the same primary key error > message with shared cache disabled, although the freezing appears to > have been fixed. > > However, when I ask the user to send me their deck, I find that: > > sqlite> pragma i

Re: [sqlite] problems with shared cache?

2009-03-20 Thread Dan
nly the three listed on this page: >> >> http://www.sqlite.org/cvstrac/wiki?p=UndoRedo >> >> So they shouldn't be modifying anything in the main DB, only the >> temporary DB. >> >> On Fri, Mar 20, 2009 at 3:13 PM, Dan wrote: >>> >>>

Re: [sqlite] question about shared cache

2009-03-24 Thread Dan
> files. That is correct. SQLite will serialize calls on a single file-handle (sqlite3_file*). You do not need a mutex for each file-handle in the OS layer. Dan. > > > > > Cheers, > > Dave. > > > > ___ > sqlit

Re: [sqlite] Sqlite3 crashes when using the where command

2009-03-25 Thread Dan
er compile > options would > be appreciated. Could be the same as this: http://www.sqlite.org/cvstrac/tktview?tn=3613 Fixed here: http://www.sqlite.org/cvstrac/chngview?cn=6364 Dan. > > -- > View this message in context: > http://www.nabble.com/Sqlite3-crashes-when-using-th

Re: [sqlite] Using the static lib of sqlite3 under 64 bit ubuntu

2009-03-29 Thread Dan
On Mar 29, 2009, at 10:01 PM, Danny De Keuleneire wrote: > Settings: > > Gcc 4.3.3 > Added usr/lib64/libsqlite3.a > > Error: > > Undefined reference to 'pthread_mutex_trylock' > > What I am missing? -lpthread -ldl ___ sqlite-users mailing list sqlit

Re: [sqlite] sqlite3_step() returning SQLITE_OK

2009-04-06 Thread Dan
n't sound right to me. What SQLite version? Can you post code that reproduces this? Thanks, Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] busy_timeout() doesn't work

2009-04-06 Thread Dan
atement executed by db2, SQLite obtains a SHARED (read) lock on the database file in order to read the database schema. Because there is a transaction open, the SHARED lock is not released when sqlite3_prepare() returns. At this point db2 has a SHARED lock and db1 has RESERVED. When sqlit

Re: [sqlite] crash on sqlite3 mutex

2009-04-06 Thread Dan
On Apr 7, 2009, at 1:11 AM, Joanne Pham wrote: > Hi all, > I have the application is used sqlite 3.5.9 and the program is > crashed with the following strack trace: > #0 0x46b35300 in pthread_mutex_lock () from /lib/libpthread.so.0 > #1 0xb6def162 in sqlite3_mutex_enter (p=0x9aca00b6) at ../s

Re: [sqlite] heap corruption?

2009-04-06 Thread Dan
: static u8 heap[1024*1024]; sqlite3_config(heap, 1024*1024, 32); If it is not SQLite corrupting the heap (it could be other parts of the app), then the crash will likely occur in some other sub-system when SQLite is configured this way. Dan. > thanks > tom > >

Re: [sqlite] Possible bug

2009-04-09 Thread Dan
On Apr 9, 2009, at 3:18 PM, Arthur Skowronek wrote: > Griggs, Donald wrote: >> This mailing list, like many, will automatically strip attachments. >> Posting onto your own webspace is a great way, as you have >> discovered, > to reference files. > Thank you for your advice :). > >> >> I'm wri

Re: [sqlite] SQLITE_CORRUPT - database disk image is malformed

2009-04-10 Thread Dan
adsafe. Call the sqlite3_threadsafe() API at runtime if you are not sure. If you have example code that can reproduce this, please file a bug here: http://www.sqlite.org/cvstrac/tktnew It sounds like this could use looking into. Dan. > Cheers, > Dave. >

Re: [sqlite] PRAGMA doesn't support parameter binds?

2009-04-13 Thread Dan
e need for a printf- > style API to sqlite3) so can anyone confirm or deny that parameter > binds do in fact not work for PRAGMA statements? Bound parameters do not work with pragma statements. Dan. > > > Thanks! > > ___ &g

Re: [sqlite] How to minimize or remove need for dirty bitmap memory size?

2009-04-14 Thread Dan
its rollback journal. [...] > > Aside from a larger page size, what remedies are suggested for > removing (or minimizing) this requirement? That statement is out of date. Since it was written the bitmap has been replaced with a better data structure that does not require the big per-transactio

Re: [sqlite] index optimization

2009-04-20 Thread Dan
On Apr 20, 2009, at 4:20 PM, galea...@korg.it wrote: > Hi, > if I've got a lot of queries as follows: > SELECT id,title FROM Song WHERE title >= 'last_title' AND > (title>'last_title' OR id>last_id) ORDER BY title ASC, id ASC > what's the best index should be created? (id is the key); > I red tha

Re: [sqlite] Sporadic freezes of sqlite

2009-04-23 Thread Dan
On Apr 23, 2009, at 10:05 PM, Pavel Ivanov wrote: > I think, this will be an awesome option for me, thanks! > I believe you are talking about sacrificing consistency not only over > power outage but over SIGKILL too, right? It's a bit worse to have > though I think it will be acceptable in my cas

Re: [sqlite] sqlite3_mutex_enter(db->mutex) problem

2009-04-30 Thread Dan
e3Step(v))==SQLITE_SCHEMA There is something wrong with the statement handle that you are passing to sqlite3_step(). Possibly the handle has already been passed to sqlite3_finalize() already. Dan. > > > > > > ___ > sqlite-users ma

[sqlite] SQLite My First App

2003-10-20 Thread Dan
'use ADO/DAO' response, not very helpful! Thanks in advance, Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

[sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-12 Thread dan
Hi, When outputting to CSV with '.mode csv' is there a way that all rows can be quoted even if there are no spaces? For example, here is a 1 line from the output: spotify:track:5vlDIGBTQmlyfERBnJOnbJ,Kiso,Circles,100.019 I would like it to output: "spotify:track:5vlDIGBTQmlyfERBnJOnbJ","Kis

Re: [sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-13 Thread dan
Thanks Richard, in the end I added the quotes using some SED and AWK as I'm using SQLite as part of a BASH script. Thanks On 2017-06-13 14:36, Richard Hipp wrote: SQLite does not provide that capability, that I recall. But surely it would not be too difficult for you to do your own custom pat

Re: [sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-15 Thread dan
Thanks Ketil I'll definitely take a look! FYI my script is available here: https://github.com/64b2b6d12b/spotkey Thanks, Dan On 2017-06-14 18:02, Ketil Froyn wrote: Dan, I'd recommend using a tool that actually understands CSV, and make it parse the input and create new quoted

Re: [sqlite] Outputting to CSV - row is not quoted when there are no spaces

2017-06-15 Thread dan
Thanks Hick, I've actually never hear of Virtual Tables so I'll take a look at play around with this. Thanks, Dan On 2017-06-14 18:44, Hick Gunter wrote: I have found it much simpler and more robust to write a CSV virtual table to handle the formatting. e.g. CREATE VIRTUAL TABLE

Re: [sqlite] Do I have to call ROLLBACK?

2013-05-04 Thread Dan
On 05/05/2013 12:53 AM, Simon Slavin wrote: On 4 May 2013, at 6:43pm, Igor Korot wrote: If I start a transaction and there will be a failure for whatever reason, do I have to call ROLLBACK? Or this transaction will just stay somewhere in a journal and will not go to db? Reading from the end o

Re: [sqlite] NULL always greater?

2007-01-30 Thread Dan Kennedy
The basic rule is that the result of any comparison involving a NULL value (including comparing against another NULL) is NULL. See the following for the details: http://www.sqlite.org/nulls.html Dan. On Tue, 2007-01-30 at 16:41 -0800, Clark Christensen wrote: > I've read through

Re: [sqlite] Obtaining randomness on win32

2007-01-31 Thread Dan Kennedy
compiling and then do something like: int myRandomSeedFunction(char *zOutputBuffer){ ... } sqlite3_os_switch()->xRandomSeed = myRandomSeedFunction; The comments in os.h have the details. Dan. > > -- > The PixAddixImage Collector suite: > http://groups-beta.google.c

Re: [sqlite] joins, brackets and non-existing columns

2007-02-01 Thread Dan Kennedy
explicitly. The workaround is to name it with an AS clause: SELECT T1T2.A FROM (T1 INNER JOIN T2 ON T1.A=T2.A) AS T1T2 ... Dan. - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] not allowing an empty column

2007-02-03 Thread Dan Kennedy
On Sat, 2007-02-03 at 00:53 -0600, P Kishor wrote: > how do I add a constraint to a column so neither null nor empty > strings ("") are allowed? > create table tbl(col CHECK (col IS NOT NULL AND col != '')); - To un

Re: [sqlite] ATTACH and :memory: databases

2007-02-07 Thread Dan Kennedy
On Wed, 2007-02-07 at 09:37 -0800, Dave Gierok wrote: > I would like to attach a :memory: database to another :memory: database. How > is this possible since the ATTACH command requires the database's file name? > > ATTACH [DATABASE] database-filename AS database-name > > -Dave Gierok I don't

RE: [sqlite] ATTACH and :memory: databases

2007-02-07 Thread Dan Kennedy
; like ':memory:2'? Nothing that I've tried works. > -Dave Gierok > > -Original Message- > From: Dan Kennedy [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 07, 2007 9:56 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] ATTACH and :memory: da

Re: [sqlite] Question on PRAGMA syntax when including database

2007-02-11 Thread Dan Kennedy
On Sun, 2007-02-11 at 22:38 -0800, tolson wrote: > Hello, > > I just finished reading through the help files and I am unclear as to when > database should be used to prefix the pragma call (i.e. PRAGMA > [database.]cache_size;). For pager pragmas not specifying a database where it is optional is

Re: [sqlite] SQLite and text encoding

2007-02-13 Thread Dan Kennedy
On Tue, 2007-02-13 at 11:58 +0200, DragonK wrote: > Hi, > > I have a table containing a text field, which is UTF-8 encoded data. I want > to know if I use sqlite3_column_text16() to retrieve the contents > of the field, would the data be automatically converted to UTF-16, or would > the character

Re: [sqlite] Re: New (ish) to C== and new to SQLite error with prepare.

2007-02-13 Thread Dan Kennedy
On Tue, 2007-02-13 at 16:18 +, Paul Simpson wrote: > rc = (sqlStepAdd)(&pStmt); rc = (sqlStepAdd)(pStmt); - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] Can't get results from PRAGMA

2007-02-14 Thread Dan Kennedy
> wxString getDBVersion = "PRAGMA user_version = 2;"; > rc = (sqlPrepareAdd)(newdb,getDBVersion.c_str(),getDBVersion.length(), > &pStmt, &pzTail); > > if(rc != SQLITE_OK){ > wxString msg; > msg.Printf(wxT("Can't process database: > %s"),(sqlErrMsgAdd

Re: [sqlite] Difference between sqlite and sqlite3

2007-02-15 Thread Dan Kennedy
On Thu, 2007-02-15 at 11:49 +0100, Pavan wrote: > Hi, > > Can anyone tell me what is the difference between sqlite and sqlite3. By itself, "sqlite" probably means SQLite version 2. Same concept as version 3 - a client library to access an SQL database stored in a single file -, but a different fi

Re: [sqlite] OR in virtual tables

2007-02-16 Thread Dan Kennedy
I think with a virtual table all you can do is: SELECT * FROM vtable WHERE x = 'a' UNION SELECT * FROM vtable WHERE x = 'b' Virtual tables cannot supply an index for WHERE clauses of the form "x IN ('a', 'b')" or "x = 'a' OR

Re: [sqlite] Question regarding REPLACE INTO and last row ID

2007-02-17 Thread Dan Kennedy
On Sat, 2007-02-17 at 00:38 -0800, Tom Olson wrote: > Hello, > > If a REPLACE INTO statement is executed and the there is an existing row > that is replaced will sqlite3_last_inserted_rowid return the rowid of the > record that was changed? REPLACE INTO doesn't change records. It replaces them. W

Re: [sqlite] deleting a single row

2007-02-19 Thread Dan Kennedy
xxx WHERE oid = (SELECT oid FROM xxx WHERE LIMIT 1) or similar. Dan. > Thanks, > > Jim > > - > T

Re: [sqlite] Effect of blobs on performance

2007-02-21 Thread Dan Kennedy
> I'm quite interested in hearing people's reasoning for going the blob route, > when you have a perfectly good "database" format for "blobs" already (various > filesystems). Three technical reasons for me personally: * Can include blob operations as part of atomic transactions. * In SQLite

Re: [sqlite] developers mailing list

2007-02-25 Thread Dan Kennedy
tcl in the build by default, but it does. Maybe that should change... If you add "-DNO_TCL" to the OPTS variable in Makefile.linux-gcc this error should go away. i.e. add the following line somewhere after the "OPTS = -DNDEBUG" bit: OPTS += -DNO_TCL Dan. - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] developers mailing list

2007-02-26 Thread Dan Kennedy
file.linux-gcc this > > error should go away. i.e. add the following line somewhere after the > > "OPTS = -DNDEBUG" bit: > > > > OPTS += -DNO_TCL > > > > > > > > Dan. > > :-( > > This i get when i use makefile which is attached to

Re: [sqlite] PRAGMA temp_store -- is there a default_temp_store?

2007-02-26 Thread Dan Kennedy
store and > calling "PRAGMA default_temp_store;" always returns nothing (although > calling "PRAGMA default_temp_store = MEMORY;" returns without error). > > If default_temp_store isn't available, is temp_store a per-con

Re: [sqlite] .dump-n-reload vs. vacuum - which is better?

2007-02-26 Thread Dan Kennedy
c will help with this. It's marked as experimental, but it will help you get around some fiddly issues with strings that look like numbers and so on. Dan. > If I think about it, the copy method has "filename" as an argument, and a > dump method for the tcl driver woul

Re: [sqlite] Table Info Pragmas as Virtual Table?

2007-02-27 Thread Dan Kennedy
ovides a read-only view of the database schema as a virtual table. Dan. > Michael > > - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] UTF16 Encoding

2007-02-28 Thread Dan Kennedy
7;d like to know how to do :) But I'm thinking you really want to do this anyway: sqlite3_open("test.db", &db); sqlite3_exec(db, "PRAGMA encoding = UTF-16", 0, 0, 0); sqlite3_open16() just converts the argument back to UTF-8 and does exactly the above anyway. Dan.

Re: [sqlite] How to interleave calls to sqlite3_prepare_v2 and sqlite3_step?

2007-02-28 Thread Dan Kennedy
statements which > then later can be executed? When you compile a statement, it is compiled against the current database schema. In the second run it tried to compile "CREATE TABLE test" against a schema that already contained the table "test". Hence the error m

Re: [sqlite] Custom collate - on field or index or both?

2007-03-01 Thread Dan Kennedy
x27; clause, and the ORDER BY, but not the lastname>'A' clause. This is because the lastname>'A' doesn't use the "mycollate" collation. If the COLLATE clause was specified as part of the table definition, then lastname>'A' would be a &

Re: [sqlite] Last ID from Primary Key through ODBC

2007-03-03 Thread Dan Kennedy
On Sat, 2007-03-03 at 19:18 -0500, Mitchell Vincent wrote: > I found the nifty ODBC driver for SQLite and have been trying to use > it to replace a 2.8 SQlite implementation in some desktop software. > It's working very well except for a rather large problem of not being > able to call the last_id

Re: [sqlite] Question about shared cache and read_uncommitted

2007-03-09 Thread Dan Kennedy
question. If Connection1 is in read_uncommitted mode, then the SELECT will neither block nor be blocked by the INSERT statement executed by Connection2. That the first database file was ATTACHed instead of being opened directly makes no difference. Dan. --

Re: [sqlite] Question about shared cache and read_uncommitted

2007-03-10 Thread Dan Kennedy
On Sat, 2007-03-10 at 22:22 +0900, Brownie wrote: > Thanks Dan, > > > That the first database file was ATTACHed instead of being opened > > directly makes no difference. > > A cache of :memory: database also be shared on shared cache mode ? > Or :memory: datab

Re: [sqlite] sqlite3_update_hook and transactions

2007-03-12 Thread Dan Kennedy
is invoked, update the GUI. When either the commit or rollback hooks are invoked, reset the data structure to empty. Dan. - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] SQLite v/s SQLite3 Performance Assay

2007-03-12 Thread Dan Kennedy
ORMAL). So if you didn't explicitly set the safety-level during the tests, then version 3 was syncing the disk more often than version 2. I think this might be why version 3 appears slower in Test Case I (Inserts). The results of cases II to IV seem odd. Can you post the test code to the list?

Re: [sqlite] a problem trying to invoke sqlite3 commands from a C application

2007-03-19 Thread Dan Kennedy
vidual dot-command: ".import file tbl\n.dump" Dan. - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] strict affinity mode

2007-03-23 Thread Dan Kennedy
fficially documented, > but without any hint on how to activate it if possible. > > IS THIS MODE EXISTING OR NOT ? I think it was a plan that did not materialize. Dan. - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] CREATE TRIGGER IF NOT EXISTS throws error

2007-03-25 Thread Dan Kennedy
I think you need 3.3.8 or greater. On Mon, 2007-03-26 at 07:39 +0200, stephan nies wrote: > I am using sqlite 3.3.5 . > > On 3/25/07, Eric Pankoke <[EMAIL PROTECTED]> wrote: > > > > What version of SQLite are you using? I'm not sure the IF EXISTS option > > was present until a certain version o

Re: [sqlite] Error reporting problem

2007-03-26 Thread Dan Kennedy
rned by sqlite3_errcode() and sqlite3_errmsg() respectively) are not populated by sqlite3_step(). After sqlite3_step() reports an error you need to call either sqlite3_reset() or sqlite3_finalize() to copy the error-code and message f

Re: [sqlite] matching only part of a string

2007-03-27 Thread Dan Kennedy
On Wed, 2007-03-28 at 12:27 +0530, Lloyd K L wrote: > Hi, > My table contains a text field called Name. Let the data be > > Name > --- > Abc > abcd > AB > cab > def > > I want to selcct all the rows which contains the term ab (not case > sensitive). How can I do this? SELECT name FROM "My

Re: [sqlite] The IN keyword

2007-03-28 Thread Dan Kennedy
If your compiler happens to define wchar_t as a 16-bit type you can get away with sqlite3_bind_text16(). However many compilers define wchar_t as 32-bit so such code is not portable. Dan. - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] The IN keyword

2007-03-28 Thread Dan Kennedy
On Wed, 2007-03-28 at 11:11 +0200, Jonas Sandman wrote: > Yes, it seems so. > > Still, can this be done without knowing how many extensions there are on > beforehand? > what happens if I make a > > SELECT * FROM Files WHERE extension IN (:ext1, :ext2, :ext3, :ext4) and only > bind :ext1 but not t

Re: [sqlite] exclusive2.test failures

2007-04-03 Thread Dan Kennedy
ve link, copying it over the old one (in the test/ directory of the source distribution) and re-running the "make test"? You don't need to do a make clean or rebuild or anything. Thanks very much. Regards, Dan. - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] Re: Default sqlite memory management policy

2007-04-04 Thread Dan Kennedy
nts above these two functions in sqlite3.h for details. SQLite should not leak memory whether this macro is defined or not. How large are the leaks you are seeing? Dan. - To unsubscribe, send email to [EMAIL PROTECTED] -

Re: [sqlite] sqlite3_prepare_v2 schema error Fatal, need help please.

2007-04-05 Thread Dan Kennedy
ite3_reset()'d? Finally, instead of re-prepairing the busted statement, what happens if you sqlite3_reset() it and then try to run it again? Dan. > > pompomJuice wrote: > > > > Hello. > > > > I recently rewrote most of my SQLite wrappers to now i

Re: [sqlite] sqlite3_prepare_v2 schema error Fatal, need help please.

2007-04-05 Thread Dan Kennedy
failing for? And are there any other SQL statements from the same handle active at the time? Definition of active: have called step() but not finalize() or reset(). Thanks, Dan. > Regards, > Werner > > > > > Dan Kennedy-4 wrote: > > > > On Thu, 2007-04-05 at

Re: [sqlite] SQL and SQLite pronounciation?

2007-04-05 Thread Dan Baker
- Original Message - From: "Dennis Cote" <[EMAIL PROTECTED]> To: "sqlite-users" Sent: Wednesday, April 04, 2007 2:24 PM Subject: [sqlite] SQL and SQLite pronounciation? Hi All, I have a simple question; how do you pronounce SQL and SQLite? In the book "SQLite" by Chris Newman on Pa

Re: [sqlite] in memory databases

2007-04-07 Thread Dan Kennedy
nt. An in-memory database will be trashed when the database connection is closed, even if the memory it was using was persistent. I'm guessing that's probably not what you're after, right? Maybe your operating system can mount the memory as a file-system and then you can create a da

Re: [sqlite] Re: FTS does not support REPLACE

2007-04-10 Thread Dan Kennedy
not be required for FTS, only for modules that used external storage). Something to think about anyhow... Do we want conflict handling for FTS (and other virtual modules)? Dan. > -scott > > > On 4/9/07, Paul Quinn <[EMAIL PROTECTED]> wrote: > > Very simple to replicate:

Re: [sqlite] Re: FTS does not support REPLACE

2007-04-11 Thread Dan Kennedy
On Tue, 2007-04-10 at 09:26 -0700, Scott Hess wrote: > On 4/10/07, Dan Kennedy <[EMAIL PROTECTED]> wrote: > > I checked the code and conflict handling mechanisms (OR ERROR, > > OR ABORT, OR REPLACE) do not apply to virtual tables. > > > Something to think about

<    1   2   3   4   5   6   7   8   9   10   >