[sqlite] query optimization

2013-11-17 Thread d b
Hi, I am trying to make single query instead of below two queries. Can somebody help? 1. delete from emp where key = '123'; 2. delete from emp where key = '123' and name = 'abc'; if Key available, execute 1st query. if key and name available, execute 2nd query. Is it possible to write in

[sqlite] Compiling sqlite (amalgamation) with ICU support for windows

2013-11-17 Thread Jens Helweg
Hello,    I am trying to compile sqlite db with icu support using cygwin on windows.    As I am using the amalgamation version my understanding is that everthing I need is already included.    But when I try to compile this it complains about missing header files:  > gcc.exe -DSQLITE_ENABLE_ICU

Re: [sqlite] Intended use case for 'without rowid'?

2013-11-17 Thread Simon Slavin
On 18 Nov 2013, at 3:38am, Peter Aronson wrote: > It might be simpler to simply specify a minimum release of SQLite that must > be supported, Actually this is how lots of apps specify their file format. Part of the file header is a version number. When the API opens the

Re: [sqlite] Intended use case for 'without rowid'?

2013-11-17 Thread Peter Aronson
For Peter & Pepijn - I think the issue is essentially a forward-compatibility problem moreso than a backward-compatibility one. So I think your idea on introducing some version control would be the least painful. Indeed. The lack of rowid itself is not an issue. It's that someone could

Re: [sqlite] Intended use case for 'without rowid'?

2013-11-17 Thread Peter Aronson
On 11/16/2013 10:46 AM, RSmith wrote: Perhaps we should make the allowed DDL subset a part of the spec. That way we make explicit what is allowed and anything outside of that is forbidden. Pepijn Perhaps. It would involve a rather large document though, one which an average user is sure

Re: [sqlite] SQLite server/file-locking scenario

2013-11-17 Thread Joshua Grauman
I don't have time right at this minute to carefully read and respond to all the responses to me, but I have to at least at this point say a heartfelt *thank you* to all those who have responded to me. I'm blown away by how detailed and helpful and patient all the responses are. When I have

Re: [sqlite] Intended use case for 'without rowid'?

2013-11-17 Thread Jean-Christophe Deschamps
How so? An AFTER INSERT trigger has the value in new.yourPKColumn. Can you show a scenario where this is insufficient, and a hypothetical last_insert_primary_key would save the day? You're correct, there is no situation where such a thing would make sense.

Re: [sqlite] Trouble with Journal_Mode Pragma

2013-11-17 Thread Stephen Chrzanowski
I think I found out why I'm getting a raised error and this will be something I'll have to remember later on dealing with PRAGMAs. There are two ways to get things done with this unit. There is GetTable which expects results back, and ExecSQL which expects exactly zero rows back. In the CLI and

Re: [sqlite] SQLite server/file-locking scenario

2013-11-17 Thread Stephen Chrzanowski
This is gonna be a long one, but I added (hopefully) some humor to make it a bit better of a read. @OP Just so I'm clear, you're pushing SQL statements from clients to your server, but then pushing raw data from the server to the client? Myself, I'd never push a "Work In Progress" database, or a

Re: [sqlite] SQLite server/file-locking scenario

2013-11-17 Thread Simon Slavin
On 17 Nov 2013, at 6:17am, Joshua Grauman wrote: > Thanks so much for the reply. Sorry for the ignorance, but wouldn't only the > sectors (page cache) that are being written need to be cached? If Unix did that (which it doesn't in any File System I know of) then that

Re: [sqlite] Trouble with Journal_Mode Pragma

2013-11-17 Thread Clemens Ladisch
Kevin Benson wrote: > Maybe it should be: > > TempDB.ExecSQL('PRAGMA journal_mode = OFF;'); > > (Note the additional semicolon in the string literal) No, semicolons are needed only as delimiter between statements (and only if multiple statements are allowed at all). Regards, Clemens

Re: [sqlite] SQLite server/file-locking scenario

2013-11-17 Thread Kees Nuyt
On Sat, 16 Nov 2013 22:17:31 -0800 (PST), Joshua Grauman wrote: >Thanks so much for the reply. Sorry for the ignorance, but wouldn't only >the sectors (page cache) that are being written need to be cached? Database pages are updated in sqlites page cache, then, being

Re: [sqlite] SQL 2003 in sqlite

2013-11-17 Thread Kees Nuyt
On Sat, 16 Nov 2013 23:59:35 +0100, Petite Abeille wrote: > >On Nov 16, 2013, at 11:02 PM, Kees Nuyt wrote: > >> For the application, the merge would look like a single >> INSERT INTO merge_t statement. > >H…. clever lateral thinking, but I doubt

Re: [sqlite] SQLite server/file-locking scenario

2013-11-17 Thread RSmith
Thanks so much for the reply. Sorry for the ignorance, but wouldn't only the sectors (page cache) that are being written need to be cached? And I was trying to read up on how sqlite does atomic writes, but doesn't the way sqlite handles atomic writes guarentee that the file is *always* in a