Re: [sqlite] Cannot write to db if it is already open for reading with shared cache

2014-08-04 Thread Richard Hipp
On Mon, Aug 4, 2014 at 4:08 PM, Кривопалов Юрий wrote: > Hello. > I getinng an error in a following scenario. I think such a behaviour is > not obvoius. > 1. Enable shared cache > 2. Open db with SQLITE_OPEN_READONLY > 3. Open same db again with SQLITE_OPEN_READWRITE > 3.1 Try to insert for last

[sqlite] Cannot write to db if it is already open for reading with shared cache

2014-08-04 Thread Кривопалов Юрий
Hello. I getinng an error in a following scenario. I think such a behaviour is not obvoius. 1. Enable shared cache 2. Open db with SQLITE_OPEN_READONLY 3. Open same db again with SQLITE_OPEN_READWRITE 3.1 Try to insert for last connection. = You get SQLITE_READONLY error. If swap 2 and 3 steps, wh

Re: [sqlite] Expected behaviour of COUNT with no GROUP BY?

2014-08-04 Thread James K. Lowden
On Mon, 04 Aug 2014 18:36:24 +0200 RSmith wrote: > > I guess I still find the combination of COUNT > > without a GROUP BY to be unintuitive, but at least I know why now. > > As far as I know, there is no requirement for a group by clause for > any of the functions really, a table or any SELECT

[sqlite] In-memory DB slower than disk-based?

2014-08-04 Thread Jensen, Vern
Hey all! We use SQLite (3.7.15.2) as the backend for a server that provides floating licenses for our software. I've recently written a stress-testing framework that starts up any number of threads, and hits the server with multiple requests per thread. While being stress-tested in this way, I'v

Re: [sqlite] Views as Virtual Tables -- Command line vs. Called Interface

2014-08-04 Thread Keith Medcalf
>TERSE QUESTION >Is the sqlite3_table_column_metadata() SQLite C API function also wrapped >by the APSW Python Library? >http://www.sqlite.org/capi3ref.html#sqlite3_table_column_metadata I don't see it presently. >Or is there another way to get the primary key without scraping the SQL >(string) f

Re: [sqlite] Expected behaviour of COUNT with no GROUP BY?

2014-08-04 Thread Zsbán Ambrus
On 8/4/14, Mark Lawrence wrote: > I try to remember to define GROUP BY values when using aggregate > functions (and I wish SQLite considered it an error otherwise) but I > forget once and the result surprised me. > > It is expected behaviour that a row is returned in this situation even > through

Re: [sqlite] Views as Virtual Tables -- Command line vs. Called Interface

2014-08-04 Thread Jim Callahan
Roger, Sorry for unintended slights. My haste and terseness may have confused matters. Another long story (below), but if you are in a hurry, my question is: TERSE QUESTION Is the sqlite3_table_column_metadata() SQLite C API function also wrapped by the APSW Python Library? http://www.sqlite.org/

Re: [sqlite] Abnormal memory usage

2014-08-04 Thread Keith Medcalf
>important correction - the problem actually exists on w2k8 (NT 6.0)(64bit >at least). The test application works as expected on w2k8 r2 (NT 6.1). >I am going to research it further, but at this point it looks like MS >Windows issue, rather than sqlite. Compiler & runtime environment breakage is

Re: [sqlite] Expected behaviour of COUNT with no GROUP BY?

2014-08-04 Thread RSmith
On 2014/08/04 18:27, Mark Lawrence wrote: On Mon Aug 04, 2014 at 06:04:53PM +0200, RSmith wrote: Yes it does, thanks. I guess I still find the combination of COUNT without a GROUP BY to be unintuitive, but at least I know why now. As far as I know, there is no requirement for a group by clause

Re: [sqlite] Expected behaviour of COUNT with no GROUP BY?

2014-08-04 Thread Mark Lawrence
On Mon Aug 04, 2014 at 06:04:53PM +0200, RSmith wrote: > CREATE TABLE x(id INTEGER); > > SELECT Count(*) FROM x; > | 0 | > > --vs.-- > SELECT Count(*) FROM x GROUP BY id; > (No Results) > > > Paints a clear picture I hope! Yes it does, thanks. I guess I still find the combination of COUNT with

Re: [sqlite] Abnormal memory usage

2014-08-04 Thread smallstone193
important correction - the problem actually exists on w2k8 (NT 6.0)(64bit at least). The test application works as expected on w2k8 r2 (NT 6.1). I am going to research it further, but at this point it looks like MS Windows issue, rather than sqlite. __

Re: [sqlite] Expected behaviour of COUNT with no GROUP BY?

2014-08-04 Thread RSmith
I'm not 100% sure if the devs had another reason for doing it this way , but the results are very much expected in normal SQL terms - simply because "count()" returns a value which is sensible and represents the actual number of items in the ungrouped list... the fact that the value returned is Z

Re: [sqlite] Expected behaviour of COUNT with no GROUP BY?

2014-08-04 Thread Richard Hipp
On Mon, Aug 4, 2014 at 11:47 AM, Mark Lawrence wrote: > > It is expected behaviour that a row is returned in this situation even > through the tables are empty? > Yes. All SQL database engines work that way. -- D. Richard Hipp d...@sqlite.org ___ sq

[sqlite] Expected behaviour of COUNT with no GROUP BY?

2014-08-04 Thread Mark Lawrence
I try to remember to define GROUP BY values when using aggregate functions (and I wish SQLite considered it an error otherwise) but I forget once and the result surprised me. CREATE TABLE x( id INTEGER ); CREATE TABLE y( id INTEGER ); SELECT x.id,

Re: [sqlite] Producing RFC4180-compliant CSV output

2014-08-04 Thread Edward Lau
Hi Peter: Specifically, if you are going to use SQL Server Integration Services (SSIS) you can specify LF as the record delimiter. It defaults to {CR}{LF} but you can change it in the FlatFile Connection Manager under the Advance tab. -Original Message- From: Peter Waller To: sqli

Re: [sqlite] parser stack overflow in view

2014-08-04 Thread Clemens Ladisch
Michael wrote: >> Von: "Richard Hipp" >> The LALR(1) parser stack is limited to a depth of 100, by default. > > Ok thanks. I reduced it by one subquery to be conform with standard builds. The parser has different limits than the SQL execution engine. You could simply move some part(s) of the quer

Re: [sqlite] HELP sqlite3 used in vxworks has someproblem?

2014-08-04 Thread Andy Ling
> -Original Message- > > 2014-08-02 16:00 GMT+02:00 王庆刚 <2004wqg2...@163.com>: > > hi , Can Sqlite3.c and sqlite.h be compiled in Workbench3.2 for > Vxworks6.8 ? > > When I compile them , there have so many problems . > > ___ > > sqlite-

Re: [sqlite] parser stack overflow in view

2014-08-04 Thread Michael
Ok thanks. I reduced it by one subquery to be conform with standard builds. My querys are auto generated and are not often needed to read by human. For my porpose it was the only way build a correct structure for searching hirarchy with needed options. category/subcat1/subcat2/subcat3 Anyway. I h