Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-23 Thread Stephan Beal
On Thu, May 23, 2013 at 7:33 AM, Prashant Shah wrote: > libsqlite4.a(fts5func.o): In function `fts5Rank': > /home/user/db/build/sqlite4/src/fts5func.c:159: undefined reference to > `log' > collect2: ld returned 1 exit status > make: *** [sqlite4] Error 1 > The problem is

Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-23 Thread Stephan Beal
On Thu, May 23, 2013 at 11:23 AM, Stephan Beal wrote: > The problem is that fts5func.c uses log() from math.h, which requires > linking against -lm. A quick workaround is to copy/paste the output from > where the build fails and add -lm to it: > Please try: - Edit

Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-23 Thread Prashant Shah
Hi, On Thu, May 23, 2013 at 3:02 PM, Stephan Beal wrote: > Please try: > > - Edit Makefile.linux-gcc and make this change: > -TLIBS = > +TLIBS ?= > > - Run: make TLIBS=-lm Works ! How do I build the libsqlite4.so shared object file ? There is no .libs folder in sqlite4

Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-23 Thread Stephan Beal
On Thu, May 23, 2013 at 11:45 AM, Prashant Shah wrote: > Works ! > :). That fix is in the trunk now. > How do I build the libsqlite4.so shared object file ? There is no > .libs folder in sqlite4 > There currently aren't build rules for the .so, but here's a quick-hack

Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-23 Thread Prashant Shah
Hi, On Thu, May 23, 2013 at 3:23 PM, Stephan Beal wrote: > gcc -fPIC -o libsqlite4.so -shared $(ar t libsqlite4.a) Works :) Thanks. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Potential bug in crash-recovery code: unlink() and friends are not synchronous

2013-05-23 Thread thanumalayan mad
I do not observe any loss in durability in WAL mode: it works totally fine. As for the documentation, http://www.sqlite.org/transactional.html and http://www.sqlite.org/features.html claim that SQLite is durable during power failures; and DELETE is the default journal_mode. Also, other pages,

Re: [sqlite] Max of 63 columns for a covering index to work?

2013-05-23 Thread Dominique Devienne
On Wed, May 22, 2013 at 9:11 PM, Marc L. Allen wrote: > [...]. It makes me think you might be better off using triggers to > maintain separate tables with covered data instead of indexes. [...]. > This sounds like Oracle's materialized views to me, which come in

Re: [sqlite] Potential bug in crash-recovery code: unlink() and friends are not synchronous

2013-05-23 Thread Marc L. Allen
Just to throw in my $0.02 as a user Given the SQL stream of... COMMIT Vs. Except in cases where, in the first example, I have time to inform someone about the COMMIT before the power loss, there's no functional difference between the two events. I would hate to think I would ever

Re: [sqlite] Max of 63 columns for a covering index to work?

2013-05-23 Thread Marc L. Allen
I'm not familiar with that. It's a "view" where Oracle actually stores the view data as a physical table? And updates these tables as the main table updates? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Dominique

Re: [sqlite] Max of 63 columns for a covering index to work?

2013-05-23 Thread Dominique Devienne
On Thu, May 23, 2013 at 3:02 PM, Marc L. Allen wrote: > I'm not familiar with that. It's a "view" where Oracle actually stores > the view data as a physical table? And updates these tables as the main > table updates? Pretty much. And the query optimizer is aware

Re: [sqlite] Potential bug in crash-recovery code: unlink() and friends are not synchronous

2013-05-23 Thread Thanumalayan Sankaranarayana Pillai
Hi Marc, Thanks for your comments! I just got confused that some SQLite webpages ( http://www.sqlite.org/transactional.html, http://www.sqlite.org/features.html) mention that transactions are durable after a power loss (the D in ACID); nowhere has it been mentioned that "immediate durability

[sqlite] [SQLite.NET] Cannot read BLOB data

2013-05-23 Thread Kevin Keigwin
I am using the 10.0.85 version of the Win32 SQLite.NET data adapter to read a spatialite database table. This table has a single geometry column in it, which stores data as a BLOB. I cannot read the data into a DataTable using the adapter, because the exception "Invalid storage type: DBNull." is

[sqlite] SQLite NULL or 0-Length

2013-05-23 Thread Jill Rabinowitz
Hello, I am having trouble with a SQLite IFNULL and replace statements. I am trying to put a value into a column that has no value / has a zero length. I am wondering whether anyone can shed light on this. I'm trying to set column firstname to 'xxx' if the column has a NULL value (or has

Re: [sqlite] SQLite NULL or 0-Length

2013-05-23 Thread Richard Hipp
On Thu, May 23, 2013 at 2:06 PM, Jill Rabinowitz wrote: > Hello, > > I am having trouble with a SQLite IFNULL and replace statements. I am > trying to put a value into a column that has no value / has a zero length. >I am wondering whether anyone can shed light on

Re: [sqlite] SQLite NULL or 0-Length

2013-05-23 Thread Simon Slavin
On 23 May 2013, at 7:06pm, Jill Rabinowitz wrote: > Does anyone know how I can check the column and set it to a value if it has > nothing in it? UPDATE myTable SET firstname='xxx' WHERE LENGTH(firstname) = 0 OR firstname IS NULL Simon.

[sqlite] Best way to implement Find commands

2013-05-23 Thread veneff
I've got a prepared statement from a original query that may have been stepped x times to row X. I want to implement the functions: FindFirst - find the first row (between row 1 and the last available row inclusive) that satisifies a new query. FindLast - find the last row (between row 1 and

[sqlite] Are RTREE virtual tables supposed to treat NULL values as 0.0?

2013-05-23 Thread Peter Aronson
So, I was looking at some triggers to update an RTREE virtual table that someone else wrote.  I noticed that the trigger didn't handle NULLs.  I was curious, and decided to see what happened if you tried to insert NULL values into an RTREE.  Actually, I rather expected it to throw an error. 

Re: [sqlite] Are RTREE virtual tables supposed to treat NULL values as 0.0?

2013-05-23 Thread Richard Hipp
RTREE only understands floating-point numbers (or integers if you use "rtree_i32" instead of "rtree"). It does not do NULLs or strings or blobs. If you give it one of these other values, it will try to convert that value into a floating-point number as best it can. The best it can do with a

Re: [sqlite] SQLite NULL or 0-Length

2013-05-23 Thread Rob Richardson
Simon, Is there a danger here if firstname is NULL and the LENGTH() function is called first? RobR -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: Thursday, May 23, 2013 2:54 PM To: General Discussion

Re: [sqlite] SQLite NULL or 0-Length

2013-05-23 Thread Marc L. Allen
No. All SQL functions can safely take NULL as an argument. LENGTH(NULL) returns NULL, so LENGTH(NULL) = 0 is always false. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Richardson Sent: Thursday, May 23, 2013 3:34 PM

Re: [sqlite] [SQLite.NET] Cannot read BLOB data

2013-05-23 Thread Joe Mistachkin
Kevin Keigwin wrote: > > I cannot read the data into a DataTable using the adapter, because the > exception "Invalid storage type: DBNull." is thrown. > There was a recently fixed issue with the SQLiteDataAdapter class. The fix can be seen here:

Re: [sqlite] Best way to implement Find commands

2013-05-23 Thread Keith Medcalf
> And, can I depend on SQLite to generate results in the same order as the > original prepare/step sequence and the temp table generation, ie. is the > temp table's rowid going to be consistent with the original step order? If you use an ORDER BY clause, yes. If not, then the rows are returned

Re: [sqlite] Best way to implement Find commands

2013-05-23 Thread Michael Falconer
Leading on from what Keith suggests above re: 'and join' can we simplify as: Findfirst: SELECT * FROM some_table WHERE original_expression AND new_expression LIMIT 1; What the LIMIT 1 will return depends on what index/primary key is in effect, sort of hoping for rowid here :-) This appears

Re: [sqlite] Best way to implement Find commands

2013-05-23 Thread Michael Falconer
OOoops typo on the FindNext, should be a min() instead of max(), i.e. SELECT * FROM some_table WHERE id = ( SELECT min(rowid) FROM ( SELECT * FROM some_table WHERE original_expression AND new_expression AND rowid > X ) ); ...typing has never been my strong point :-) On Fri, May 24, 2013

Re: [sqlite] Best way to implement Find commands

2013-05-23 Thread Keith Medcalf
The real problem is going to be the breakpoint and ordering. FindFirst is simply a re-execution of the query. FindLast is the same, with inverted ordering. FindNext is just stepping (or issuing the same query but adding a condition to start after the breakboint). FindPrevious is simply the