Re: [sqlite] Recursive query?

2014-01-08 Thread Petite Abeille
WITH RECURSIVE syntax. Their original request specified Oracle10g-compatible CONNECT-BY syntax. It depends on what the sponsor really wants. (We await their reply.) The code will only make it into trunk if the sponsor selects WITH RECURSIVE. On Wed, Jan 8, 2014 at 1:33 PM, Petite Abeille

Re: [sqlite] Common Table Expression

2014-01-06 Thread Petite Abeille
Hello, On Jan 6, 2014, at 6:51 AM, James K. Lowden jklow...@schemamania.org wrote: You're welcome to your opinion, of course. But you're really not answering my point, and I object to your assertion that I'm clinging to 1986. Apologies about that. The 1986 reference was more pointed to

Re: [sqlite] RFE: Rename Column

2014-01-05 Thread Petite Abeille
On Jan 5, 2014, at 6:56 PM, Igor Tandetnik i...@tandetnik.org wrote: On 1/4/2014 7:15 PM, Elrond wrote: Short: Could you implement alter table rename column? The problem would be, what to do with all the indexes, triggers, views and foreign keys that reference that column? Sure, but

Re: [sqlite] Common Table Expression

2014-01-04 Thread Petite Abeille
On Jan 4, 2014, at 8:05 PM, James K. Lowden jklow...@schemamania.org wrote: That's an aesthetic judgement. Even if I agreed, it doesn't change the fact that every language feature is an element of complexity, and redundant language features are needless complexity. Things change. Syntax

Re: [sqlite] Common Table Expression

2014-01-04 Thread Petite Abeille
On Jan 4, 2014, at 11:34 PM, RSmith rsm...@rsweb.co.za wrote: . I think in America the term Captain Obvious is used for the author of such a statement. This sounds like a job for ObviousMan! http://treesflowersbirds.files.wordpress.com/2010/01/obviousman.jpg things _are_ moving forward

Re: [sqlite] Common Table Expression

2014-01-01 Thread Petite Abeille
On Jan 1, 2014, at 10:55 PM, James K. Lowden jklow...@schemamania.org wrote: CTE ... bring capabilities to the users, by simplifying the use of the underlying tool. CTEs would add complexity, not simplify. Nonsense, dear Sir :) Yes, a ‘with’ clause is just syntax sugar providing named

Re: [sqlite] Hook / Trigger for Primary Key / Unique Error

2014-01-01 Thread Petite Abeille
On Dec 30, 2013, at 1:48 PM, Richard Hipp d...@sqlite.org wrote: One example: sqlite3_exec(INSERT OR IGNORE INTO ;); if( sqlite3_changes()==0 ){ sqlite3_exec(UPDATE ...); } This is rather error prone and may results in, well, unexpected results. How to lose your data in

Re: [sqlite] SQLite 2013 retrospective

2014-01-01 Thread Petite Abeille
On Dec 31, 2013, at 5:37 PM, Richard Hipp d...@sqlite.org wrote: In addition to the above, there are countless new test cases and minor feature and performance enhancements. Thank you so much for for all the hard work :) Our goal is to maintain this aggressive pace of innovation and

Re: [sqlite] select only records with fields that BEGIN with a certain sub-string

2013-12-26 Thread Petite Abeille
On Dec 26, 2013, at 11:49 AM, dean gwilliam mgbg25...@blueyonder.co.uk wrote: ...is this possible or should I return the whole lot and subject it to a regexp filter to get my cut-down list? http://www.sqlite.org/lang_expr.html#like ___

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-12-09 Thread Petite Abeille
On Dec 9, 2013, at 8:01 PM, Warren Young war...@etr-usa.com wrote: I remember reading an essay by a user of controlled substances Your next reading assignment is a book[3] on a functional programming language, So… do you make your functions wear a purity ring? To keep them, hmmm, chaste?

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-11-24 Thread Petite Abeille
On Nov 24, 2013, at 3:17 PM, Doug Currie doug.cur...@gmail.com wrote: There is value in compatibility, but those adjectives are awful. FWIW, DETERMINISTIC is what Oracle uses: http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/function.htm#LNPLS1183 I would personally stick to that if

Re: [sqlite] SQLite version 3.8.2 running 2.5x faster for some queries.

2013-11-24 Thread Petite Abeille
On Nov 24, 2013, at 7:10 PM, Valentin Davydov sqlite-u...@soi.spb.ru wrote: Wait a second... and you'll get different value of datetime('now'). In this sense datetime() is as deterministic as random(): it may give the same result next invocation or may not, dependng on various circumstances

Re: [sqlite] SQL 2003 in sqlite

2013-11-16 Thread Petite Abeille
On Nov 16, 2013, at 4:11 PM, James K. Lowden jklow...@schemamania.org wrote: The logical equivalent of MERGE is accomplished by one INSERT and one UPDATE inside a user-defined transaction. Given SQLite's locking semantics, it's atomic. Nothing procedural about it. Well, one would still

Re: [sqlite] SQL 2003 in sqlite

2013-11-16 Thread Petite Abeille
On Nov 16, 2013, at 11:02 PM, Kees Nuyt k.n...@zonnet.nl wrote: For the application, the merge would look like a single INSERT INTO merge_t statement. H…. clever lateral thinking, but I doubt this will fly in practice :) Two main issues: (1) ‘or ignore’ is most likely inappropriate as

Re: [sqlite] SQL 2003 in sqlite

2013-11-13 Thread Petite Abeille
On Nov 13, 2013, at 4:38 PM, Simon Slavin slav...@bigfraud.org wrote: I still don't know what function that MERGE does that you can't do in SQLite. Are you asking what MERGE does? Or if it’s possible to somehow emulate that functionality in SQLite? If the later, then yes, surely one could

Re: [sqlite] SQL 2003 in sqlite

2013-11-13 Thread Petite Abeille
On Nov 13, 2013, at 8:03 PM, Simon Slavin slav...@bigfraud.org wrote: or do they need some specific functionality which MERGE has and SQLite doesn’t. There are no equivalent in SQLite at all. One cannot do even the most basic of upsert with the SQL available. The functionality is just not

Re: [sqlite] SQL 2003 in sqlite

2013-11-12 Thread Petite Abeille
On Nov 12, 2013, at 9:49 AM, Simon Slavin slav...@bigfraud.org wrote: The merge statement is really missing in sqlite… Yes, very much so. SQLite does have this form of the INSERT statement: http://www.sqlite.org/lang_conflict.html Sadly, none of these ‘on conflit’ options are of any use

Re: [sqlite] report bugs-update

2013-11-10 Thread Petite Abeille
On Nov 10, 2013, at 1:51 AM, BULUSLI quanwei9...@126.com wrote: hello Sir,I don't Know this isn't a bug http://www.sqlite.org/compile.html#enable_update_delete_limit ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Handling Pictures

2013-11-06 Thread Petite Abeille
On Nov 6, 2013, at 7:42 PM, Ulrich Goebel m...@fam-goebel.de wrote: Every hint is welcome! Don't store your files in the database. Store them on the file system, as the Almighty intended. Much simpler and flexible altogether. Perhaps of interest:

Re: [sqlite] Handling Pictures

2013-11-06 Thread Petite Abeille
On Nov 6, 2013, at 8:00 PM, Richard Hipp d...@sqlite.org wrote: See http://www.sqlite.org/whentouse.html#appfileformat for further thoughts on this. SQLite is commonly used as an application file format. In such cases, it is entirely appropriate to store content files directly in the

Re: [sqlite] Text file import by column number

2013-10-27 Thread Petite Abeille
On Oct 26, 2013, at 2:08 AM, James K. Lowden jklow...@schemamania.org wrote: awk is your friend. 'cut' is even friendlier for simple tasks like those :) ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Trigger SQL and database schema

2013-10-15 Thread Petite Abeille
On Oct 16, 2013, at 7:20 AM, Darren Duncan dar...@darrenduncan.net wrote: On 2013.10.14 11:58 PM, Sqlite Dog wrote: seems like SQLite is not checking trigger SQL for invalid column names until execution? What you describe sounds like the behavior of every SQL DBMS which has triggers

Re: [sqlite] Easy way to change a column

2013-10-09 Thread Petite Abeille
On Oct 9, 2013, at 2:50 AM, Bao Niu niuba...@gmail.com wrote: For SQLite is there an easy way to find out ALL other tables, queries and triggers that will be affected when performing a change to a particular column under the cursor? No. That would make refactoring so much easier. Yes.

Re: [sqlite] COMMIT in SQLite

2013-10-08 Thread Petite Abeille
On Oct 8, 2013, at 8:10 PM, Stephan Beal sgb...@googlemail.com wrote: (link to the original post not included because the archives are only visible to list members): Hmm? http://news.gmane.org/gmane.comp.version-control.fossil-scm.user ___

Re: [sqlite] Bug : Tcl interface + INSERT OR REPLACE statement

2013-09-24 Thread Petite Abeille
On Sep 23, 2013, at 6:19 PM, Jean-Marie CUAZ jm.c...@orens.fr wrote: - no exception is raised to host langage Tcl for 2 rows not inserted because a UNIQUE constraint is not respected - partial execution : 2 rows are definitely deleted from the table ...(ouch !) Yep. Looks like it does

Re: [sqlite] SQLite3 3.7.17 = using column names with character '@'.

2013-09-24 Thread Petite Abeille
On Sep 24, 2013, at 7:59 PM, Dan Kennedy danielk1...@gmail.com wrote: A double quoted string is treated as a column name if possible, or a string literal otherwise. It's an SQL thing. Nah. The second part is a SQLite thing. Randomly converting identifiers into literals is more of a

Re: [sqlite] Bug : Tcl interface + INSERT OR REPLACE statement

2013-09-24 Thread Petite Abeille
On Sep 24, 2013, at 7:54 PM, Marc L. Allen mlal...@outsitenetworks.com wrote: Yep. What most people want is an INSERT OR UPDATE. Yep. Which is what one usually calls 'MERGE': http://en.wikipedia.org/wiki/Merge_(SQL) And sadly, SQLite doesn't provide anything like that at all. Oh, well…

Re: [sqlite] Bug : Tcl interface + INSERT OR REPLACE statement

2013-09-24 Thread Petite Abeille
On Sep 24, 2013, at 8:06 PM, Marc L. Allen mlal...@outsitenetworks.com wrote: Considered harmful? How so? I wouldn't mind a version of ON CONFLICT UPDATE fieldlist. In its current form. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Bug : Tcl interface + INSERT OR REPLACE statement

2013-09-24 Thread Petite Abeille
On Sep 24, 2013, at 8:09 PM, Marc L. Allen mlal...@outsitenetworks.com wrote: Not complaining, mind you. MS SQL doesn't have it, and I've long learned to deal with it. MS SQL Server sports a MERGE statement if I'm not mistaken: http://msdn.microsoft.com/en-us/library/bb510625.aspx

Re: [sqlite] Bug : Tcl interface + INSERT OR REPLACE statement

2013-09-24 Thread Petite Abeille
On Sep 24, 2013, at 8:05 PM, Simon Slavin slav...@bigfraud.org wrote: Which is why you do an INSERT first, and allow it to fail, then do the UPDATE. Sure. A lot of error proce procedural code to do what one SQL statement could do much more naturally.

Re: [sqlite] Bug : Tcl interface + INSERT OR REPLACE statement

2013-09-24 Thread Petite Abeille
On Sep 24, 2013, at 8:16 PM, Simon Slavin slav...@bigfraud.org wrote: The first version (INSERT OR FAIL, then UPDATE) won't lead to any SQLite errors if one of the rows already exists. So you can do a whole lot of both lines in one transaction and the transaction will still succeed. Is

Re: [sqlite] SQLite clusters?

2013-09-17 Thread Petite Abeille
On Sep 17, 2013, at 10:19 PM, Paolo Bolzoni paolo.bolzoni.br...@gmail.com wrote: Sorry for the out topic, but why you want to leave 0mq? We always found it great... Isn't nanomsg the successor of ZeroMQ? I.e. same guy, same project, mark 4 or 5?

Re: [sqlite] Select with dates

2013-09-16 Thread Petite Abeille
On Sep 16, 2013, at 10:48 AM, Niall O'Reilly niall.orei...@ucd.ie wrote: Consecutive closed intervals overlap. Depending on the application, this may be a problem; it can be avoided by using half-open ones. What about simply using not overlapping intervals and call it a

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Petite Abeille
On Sep 15, 2013, at 12:53 AM, Kees Nuyt k.n...@zonnet.nl wrote: 3) If an SQL-statement generally contains more than one reference to one or more datetime value functions, then all such ref- erences are effectively evaluated simultaneously. FWIW, Oracle concurs: All of the datetime

Re: [sqlite] Question about date time

2013-09-15 Thread Petite Abeille
On Sep 15, 2013, at 8:31 PM, William Drago wdr...@suffolk.lib.ny.us wrote: Thanks for the reply. Seconds since the epoch does make a good timestamp. Is that what is normally used to extract data between time periods? (Date Time seems to be a popular topic at the moment) There is nothing

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Petite Abeille
On Sep 15, 2013, at 10:32 PM, Keith Medcalf kmedc...@dessus.com wrote: On the other hand, if one knows that the value of 'now' is not stable then one can always bind a parameter with the appropriate value set from the host language Or write it down somewhere once (i.e temp table), or

Re: [sqlite] Select with dates

2013-09-14 Thread Petite Abeille
On Sep 14, 2013, at 4:24 AM, James K. Lowden jklow...@schemamania.org wrote: Why not SELECT * FROM entry WHERE bankdate = date('now','start of month') AND bankdate date('now','start of month','+1 month') The half-open interval strikes again! :-) Yeah... not sure

Re: [sqlite] Please help me optimize this LEFT JOIN query.

2013-09-05 Thread Petite Abeille
On Sep 4, 2013, at 4:21 PM, Yuzem naujnit...@gmail.com wrote: I want to construct genres icons and each icon must display 4 movies. Assuming this is IMDB… what about a scalar subquery? For example, assuming a slightly different schema from yours: selectgenre.code as genre, (

Re: [sqlite] Please help me optimize this LEFT JOIN query.

2013-09-05 Thread Petite Abeille
On Sep 5, 2013, at 8:56 PM, Yuzem naujnit...@gmail.com wrote: SELECT genres FROM genres LEFT JOIN movies ON genres.movies = movies.movies GROUP BY genres ORDER BY genres; time: 2.475s SELECT genres FROM genres JOIN movies ON genres.movies = movies.movies GROUP BY genres ORDER BY genres;

Re: [sqlite] Please help me optimize this LEFT JOIN query.

2013-09-05 Thread Petite Abeille
On Sep 5, 2013, at 10:28 PM, Yuzem naujnit...@gmail.com wrote: Ok, wonderful, now it is working correctly but how do I select multiple columns from table movies? Should I add another sub query? Nope. You have now changed the problem definition, so scalars will not be a good fit. Blindly

Re: [sqlite] Please help me optimize this LEFT JOIN query.

2013-09-05 Thread Petite Abeille
On Sep 5, 2013, at 11:27 PM, Yuzem naujnit...@gmail.com wrote: Any clue on why LEFT JOIN is so slow when used with genres but not with larger tables? Sure. But your conclusion is a most likely a red herring. The crux of the matter is that inner and outer join have a wildly different

Re: [sqlite] Please help me optimize this LEFT JOIN query.

2013-09-05 Thread Petite Abeille
On Sep 5, 2013, at 9:45 PM, Yuzem naujnit...@gmail.com wrote: It is incredibly fast but it gives me the wrong result: Yeah… you forgot the 'where' clause in the subquery… you need to restrict it on the genre ___ sqlite-users mailing list

Re: [sqlite] T-SQL to retrieve needed records

2013-08-31 Thread Petite Abeille
On Aug 31, 2013, at 6:42 PM, James K. Lowden jklow...@schemamania.org wrote: I changed the data (see below) because *meaning* of recordings.ends should be an exclusive end, what's knows as a half-open interval. That makes the question of does b follow a one of equality. It is likely not the

Re: [sqlite] Number of Colum!!!

2013-08-13 Thread Petite Abeille
On Aug 13, 2013, at 4:11 PM, techi eth techi...@gmail.com wrote: Trigger Logic!!! Default Constraint Behaviour!!! sqlite3 error string size!!! Number of Colum!!! What's up with the triple exclamation marks since July 22nd? ___ sqlite-users

Re: [sqlite] Slow Query on large database Help

2013-08-08 Thread Petite Abeille
On Aug 8, 2013, at 3:40 PM, Christopher W. Steenwyk csteen...@gmail.com wrote: This database is generated once, and then queried and interrogated multiple times. So I am most concerned with read speed and not with writing or updating. Ohohoho… in that case… I have some snake oil to sell you,

Re: [sqlite] Slow Query on large database Help

2013-08-07 Thread Petite Abeille
On Aug 7, 2013, at 8:54 PM, Christopher W. Steenwyk csteen...@gmail.com wrote: The attached query takes over 6 days to run. “Patience – A minor form of despair, disguised as a virtue.” Also… attachments are stripped out by the mailing list. You may want to try to inline them instead.

Re: [sqlite] Slow Query on large database Help

2013-08-07 Thread Petite Abeille
On Aug 7, 2013, at 9:25 PM, Christopher W. Steenwyk csteen...@gmail.com wrote: Ah, sorry about the attachments, you can find the files here: https://www.dropbox.com/l/fpFfcjwwcyhXZgduswCggb And yes, as the final part of the DB creation I do run ANALYZE. And I do think the indexes are

Re: [sqlite] Slow Query on large database Help

2013-08-07 Thread Petite Abeille
On Aug 7, 2013, at 9:25 PM, Christopher W. Steenwyk csteen...@gmail.com wrote: Ah, sorry about the attachments, you can find the files here: https://www.dropbox.com/l/fpFfcjwwcyhXZgduswCggb Ah, also, your schema has a very, hmmm, Entity–attribute–value (EAV) smell to it (object, attribute,

Re: [sqlite] Is REAL the best universal data type?

2013-07-24 Thread Petite Abeille
On Jul 23, 2013, at 9:32 PM, Max Vlasov max.vla...@gmail.com wrote: On Tue, Jul 23, 2013 at 10:09 PM, Petite Abeille petite.abei...@gmail.comwrote: On Jul 23, 2013, at 9:52 AM, Max Vlasov max.vla...@gmail.com wrote: Basically it's several tables implementing Object-Propery-Value

Re: [sqlite] Is REAL the best universal data type?

2013-07-23 Thread Petite Abeille
On Jul 23, 2013, at 9:52 AM, Max Vlasov max.vla...@gmail.com wrote: Basically it's several tables implementing Object-Propery-Value metaphor Hurray! The Entity–attribute–value (EAV) anti-pattern! … an EAV based approach is an anti-pattern which can lead to longer development times, poor use

Re: [sqlite] FTS4 search for terms inside a word

2013-07-22 Thread Petite Abeille
On Jul 22, 2013, at 3:29 PM, Marco Bambini ma...@sqlabs.net wrote: I have a virtual FTS4 table and I would like to search for some terms inside a word, is that possible? Not with the default tokenizers, but perhaps you could write your own, say an ngram tokenizer or such.

Re: [sqlite] Anything like select 7 as a, 8 as b, a / b as c; possible whatsoever?

2013-07-21 Thread Petite Abeille
On Jul 21, 2013, at 7:47 PM, Igor Tandetnik i...@tandetnik.org wrote: This query is in fact perfectly legal. It's OK to refer to column aliases in ORDER BY clause. Perhaps in SQLite, yes. select 1 as a order by 1; select 1 as a order by a; select x as a from ( select 1 as x ) order by a;

Re: [sqlite] Order By clause in aggregate functions?

2013-07-21 Thread Petite Abeille
On Jul 21, 2013, at 10:15 PM, ss griffon ssgriffonu...@gmail.com wrote: I'm writing an extension to SQLite that adds some aggregate functions. Some of them, require that the rows passed to the aggregate function be sorted. It seems as if lots of data bases (MySQL, PostgreSQL) support an

Re: [sqlite] Guidance with Python and nested cursors

2013-07-17 Thread Petite Abeille
On Jul 17, 2013, at 9:07 PM, Joseph L. Casale jcas...@activenetwerx.com wrote: I am using Python to query a table for all its rows, for each row, I query related rows from a second table, then perform some processing and insert in to a third table. What is the technically correct approach

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-25 Thread Petite Abeille
On Jun 25, 2013, at 11:19 AM, Nißl Reinhard reinhard.ni...@fee.de wrote: because it stays in quotation mode until it finds a further , which is incorrect. Quotation mode may only get activated when appears at the beginning of a column value. Meh… check the recent escape quote for csv

Re: [sqlite] escape quote for csv import

2013-06-18 Thread Petite Abeille
On Jun 18, 2013, at 10:02 PM, Clemens Ladisch clem...@ladisch.de wrote: (There is no official CSV standard, and there is no widely supported escaping mechanism.) Perhaps. But that's not an excuse to ignore the de facto convention: Common Format and MIME Type for Comma-Separated Values (CSV)

Re: [sqlite] escape quote for csv import

2013-06-18 Thread Petite Abeille
On Jun 18, 2013, at 10:46 PM, Roland Hughes rhug...@cincinnati-test.com wrote: It isn't documented anywhere, but, you have to BOTH quote the string AND double up the quotes inside of it. Indeed: 7. If double-quotes are used to enclose fields, then a double-quote appearing inside

Re: [sqlite] escape quote for csv import

2013-06-18 Thread Petite Abeille
On Jun 18, 2013, at 11:07 PM, Roland Hughes rhug...@cincinnati-test.com wrote: and tools.ietf.org is exactly WHERE on the sqlite.org path? Everything is amazing and nobody is happy -- Louis CK ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Feature request: add support for COMMENT statement

2013-06-17 Thread Petite Abeille
On Jun 17, 2013, at 6:14 PM, Roman Fleysher roman.fleys...@einstein.yu.edu wrote: Dear SQLiters, First thing first… don't hijack a thread… instead start a new one, with a new subject. Can someone recommend an ORM? No. What are the pros and cons of using them?

Re: [sqlite] Updating a table from itself

2013-06-09 Thread Petite Abeille
On Jun 9, 2013, at 5:25 PM, E.Pasma pasm...@concepts.nl wrote: Yes, unfortunately. I would love to see some form of UPDATE FROM make it into SQLite, but none such exists at the moment. -- Igor Tandetnik Possibly INSERT OR REPLACE is useful when multiple columns need to be updated.

Re: [sqlite] Serialize an in-memory database

2013-06-05 Thread Petite Abeille
On Jun 5, 2013, at 9:10 PM, Philip Bennefall phi...@blastbay.com wrote: Yes, I have seen the backup API. But I would like to avoid the disk file entirely and just serialize to and from memory. Lateral thinking… write your db to tmpfs… ___

Re: [sqlite] Serialize an in-memory database

2013-06-05 Thread Petite Abeille
On Jun 5, 2013, at 9:25 PM, Philip Bennefall phi...@blastbay.com wrote: Doesn't that still create a file, just a temporary one? I need the serialized content in a char* or similar so I can memcpy it etc, and then feed it back to SqLite at a later time. I guess I could make a toy vfs that

Re: [sqlite] Serialize an in-memory database

2013-06-05 Thread Petite Abeille
On Jun 5, 2013, at 9:38 PM, Philip Bennefall phi...@blastbay.com wrote: I don't want it in a file, however. I want it in a memory block. So tmpfs wouldn't do the trick from what I gather. … tmpfs *is* memory… just looks like a file system… http://en.wikipedia.org/wiki/Tmpfs

Re: [sqlite] Serialize an in-memory database

2013-06-05 Thread Petite Abeille
On Jun 5, 2013, at 9:44 PM, Philip Bennefall phi...@blastbay.com wrote: I use Windows. This looks like it is purely for Unix variants? I suspect one call these 'RAM disk/drive' as well... http://en.wikipedia.org/wiki/List_of_RAM_drive_software I need something that operates wherever SqLite

Re: [sqlite] Serialize an in-memory database

2013-06-05 Thread Petite Abeille
On Jun 5, 2013, at 10:02 PM, Philip Bennefall phi...@blastbay.com wrote: That is exactly the sort of thing I am looking for. If anything, I think it'd be great to have such a vfs in SqLite if only for completeness/customizability, seeing as how there are so many different allocators for

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

2013-05-22 Thread Petite Abeille
On May 22, 2013, at 8:58 PM, David de Regt dav...@mylollc.com wrote: Back to the trenches to rearchitect this… Perhaps an opportunity to introduce bitmap indexes to SQLite… which would render compound indexes a thing of the past for certain class of problems such as yours...

Re: [sqlite] Problem with index on multiple columns

2013-05-17 Thread Petite Abeille
On May 17, 2013, at 10:54 AM, Konstantinos Alogariastos marau...@gmail.com wrote: Does this mean that one cannot use a index on two columns when in the query both columns are used with IN? You might want to read up on the query planner: http://www.sqlite.org/queryplanner.html#searching The

Re: [sqlite] Problem with index on multiple columns

2013-05-17 Thread Petite Abeille
On May 18, 2013, at 3:13 AM, Keith Medcalf kmedc...@dessus.com wrote: This applies *only* to the rowid (integer primary key). Other indexes (as in CREATE INDEX) are always unique since the key always contains the rowid as the final (unspoken) component. A unique index must be unique

Re: [sqlite] Possible bug in type conversion prior to comparison

2013-05-13 Thread Petite Abeille
On May 13, 2013, at 6:12 PM, Simon Slavin slav...@bigfraud.org wrote: I should have asked you for (1,2,20) as well and we could see whether it outputs '10' or '10.0'. But yes, it would appear that in Oracle, NUMERIC means FLOAT. Nah. Plus there is no such type as 'NUMERIC' per se in

Re: [sqlite] SQL join with or condition gives unexpected results

2013-05-09 Thread Petite Abeille
On May 9, 2013, at 3:30 PM, Romulo Ceccon romulocec...@gmail.com wrote: But my application is (so far) database agnostic Reconsider. Agnosticism is not a feature. It's a bug. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] looking up records with terms in a table

2013-03-26 Thread Petite Abeille
On Mar 26, 2013, at 10:36 PM, Paul Mathieu pmath...@intellimed.com wrote: SELECT Sentences FROM T1 JOIN T2 ON T1.Sentences LIKE CONCAT('%',T2.Terms,'%') Alternatively, use FTS [1]: sqlite create virtual table sentence using fts4( content text ); sqlite insert into sentence values( 'FTS3 and

Re: [sqlite] pragma table_info(database.table) not supported

2013-03-25 Thread Petite Abeille
On Mar 21, 2013, at 6:41 PM, Peter Haworth p...@lcsql.com wrote: I found the code in the two attached files (are they allowed on this list?) on the web a while back. The claim was that it created an information schema database from an sqlite db. I know nothing about Lua but I managed to

Re: [sqlite] How do I write a query

2013-03-24 Thread Petite Abeille
On Mar 24, 2013, at 4:13 PM, Simon Slavin slav...@bigfraud.org wrote: SELECT playerid FROM players WHERE playerid IS NOT IN (SELECT playerid FROM draftedplayers) Alternatively: select playerid fromplayers where not exists ( select 1 from

Re: [sqlite] How do I write a query

2013-03-24 Thread Petite Abeille
On Mar 24, 2013, at 8:30 PM, Larry Brasfield larry_brasfi...@iinet.com wrote: That said… it seems to be odd to have a 'player' vs . 'draftedplayers' table… looks like a typical is_a vs has_a confusion... The table named 'draftedplayers' is simply a many-to-many relation between the

Re: [sqlite] pragma table_info(database.table) not supported

2013-03-20 Thread Petite Abeille
On Mar 20, 2013, at 6:53 PM, Jay A. Kreibich j...@kreibi.ch wrote: If there is any change I'd like to see, it is that all the PRAGMAs that return tabular data should really be system catalog tables. Triple hurray for that! SQLite deserves a proper data dictionary, no question asked. What

Re: [sqlite] [sqlite-dev] SQLite version 3.7.16

2013-03-20 Thread Petite Abeille
On Mar 19, 2013, at 11:25 PM, Richard Hipp d...@sqlite.org wrote: Try static linking. Example of how to build a shell that contains spellfix1: For the record, aside from being a great little SQL engine, gems like FTS and spellfix are really what make SQLite truly outstanding. Thanks for that

Re: [sqlite] [sqlite-dev] SQLite version 3.7.16

2013-03-20 Thread Petite Abeille
On Mar 20, 2013, at 11:19 PM, Simon Slavin slav...@bigfraud.org wrote: What on earth is spellfix ? I don't remember having heard of it before. googling doesn't seem to turn up any page which says This is what spellfix is.. http://www.sqlite.org/draft/spellfix1.html

Re: [sqlite] [sqlite-dev] SQLite version 3.7.16

2013-03-19 Thread Petite Abeille
On Mar 19, 2013, at 1:33 PM, D. Richard Hipp d...@hwaci.com wrote: http://www.sqlite.org/releaselog/3_7_16.html • Enhance the spellfix1 extension so that the edit distance cost table can be changed at runtime by inserting a string like 'edit_cost_table=TABLE' into the command field. Is

Re: [sqlite] sqlite and Mac App Store sandbox

2013-03-18 Thread Petite Abeille
On Mar 18, 2013, at 8:02 PM, Marco Bambini ma...@sqlabs.net wrote: Anyone have another solution? You may have better luck at cocoa-...@lists.apple.com . In the meantime:

Re: [sqlite] Fuzzy joins

2013-03-11 Thread Petite Abeille
On Mar 11, 2013, at 4:54 PM, David Bicking dbic...@yahoo.com wrote: Am I missing an obviously better way to do it? A way that can easily be expanded when they come back to me and say if I looked at a fifth column, you'd have been able to match it…. As they stand, your updates will always

Re: [sqlite] Fuzzy joins

2013-03-11 Thread Petite Abeille
On Mar 11, 2013, at 10:32 PM, David Bicking dbic...@yahoo.com wrote: Um, I am wrong, cause I just tried it and sqlite only returns the level 5 result. I have no clue why! The joins are setup from most specific to broadest. Each join is evaluated only if the previous one returns null (i.e.

Re: [sqlite] SQLite strong-typing [WAS: inner vs. outer join inconsistency]

2013-03-07 Thread Petite Abeille
On Mar 7, 2013, at 6:21 AM, Nico Williams n...@cryptonector.com wrote: In conclusion, if you want to allow affine type conversions on INSERT, but not disallow values that cannot be so converted, then CHECK(my_column = CAST(my_column AS TYPE)) works. And if you want to disallow values of

Re: [sqlite] SQLite strong-typing [WAS: inner vs. outer join inconsistency]

2013-03-07 Thread Petite Abeille
On Mar 7, 2013, at 7:53 PM, Ryan Johnson ryan.john...@cs.utoronto.ca wrote: Meanwhile, though, I'd be delighted if column affinity, cast(), implicit conversions performed by arithmetic operations, check(), and triggers all behaved the same way, with the current behavior of column affinity

Re: [sqlite] How can I improve this query?

2013-03-06 Thread Petite Abeille
On Mar 5, 2013, at 10:41 PM, Yuzem naujnit...@gmail.com wrote: Hello, I have the following tables: CREATE TABLE movies (movies,name); CREATE TABLE genres (movies,genres); IMDB? Every movie has many genres and every genre has many movies. I want to list all genres but those who match a

Re: [sqlite] SQLite strong-typing [WAS: inner vs. outer join inconsistency]

2013-03-06 Thread Petite Abeille
On Mar 6, 2013, at 10:24 PM, Nico Williams n...@cryptonector.com wrote: CREATE TABLE toy(a INTEGER CHECK(a = CAST(a AS INTEGER))); Any idea on the cost of such check? In term of overhead? Just curious. ___ sqlite-users mailing list

Re: [sqlite] SQLite strong-typing [WAS: inner vs. outer join inconsistency]

2013-03-06 Thread Petite Abeille
On Mar 6, 2013, at 10:24 PM, Nico Williams n...@cryptonector.com wrote: Nah, use this sort of CHECK constraint: CREATE TABLE toy(a INTEGER CHECK(a = CAST(a AS INTEGER))); Hmmm… on second thought… is that an assignment in that check constraint?!? I.e. are you reassigning a to a new cast

Re: [sqlite] SQLite strong-typing [WAS: inner vs. outer join inconsistency]

2013-03-06 Thread Petite Abeille
On Mar 6, 2013, at 10:43 PM, Petite Abeille petite.abei...@gmail.com wrote: CREATE TABLE toy(a INTEGER CHECK(a = CAST(a AS INTEGER))); Hmmm… on second thought… is that an assignment in that check constraint?!? I.e. are you reassigning a to a new cast value?!? Are not check constraint

Re: [sqlite] SQLite strong-typing [WAS: inner vs. outer join inconsistency]

2013-03-06 Thread Petite Abeille
On Mar 6, 2013, at 10:47 PM, Nico Williams n...@cryptonector.com wrote: Hmmm… on second thought… is that an assignment in that check constraint?!? I.e. are you reassigning a to a new cast value?!? No. The only place where = is an assignment is in UPDATE statements, in the SET clause.

Re: [sqlite] SQLite strong-typing [WAS: inner vs. outer join inconsistency]

2013-03-06 Thread Petite Abeille
On Mar 6, 2013, at 10:49 PM, Nico Williams n...@cryptonector.com wrote: Ah, your confusion comes from the fact that type conversion still happens when the INSERT gets around to making the record. The CHECK constraint happens before the record is made. See the vdbe that gets generated. All

Re: [sqlite] SQLite strong-typing [WAS: inner vs. outer join inconsistency]

2013-03-06 Thread Petite Abeille
On Mar 6, 2013, at 11:53 PM, Nico Williams n...@cryptonector.com wrote: o k i d o k i . . . Oh. Oh.. Ew.. Never mind then! Yeah… a bit of a mind melt… nevertheless… such check should work as advertised… even handles nulls properly… perhaps too clever too... :D All magic comes with a

Re: [sqlite] Break on cumulative sum

2013-03-05 Thread Petite Abeille
On Mar 5, 2013, at 8:19 AM, James K. Lowden jklow...@schemamania.org wrote: Postgresql has also had them for a while. Yes, and if I'm not mistaken Ingres's QUEL had them long before that. Yes, many databases have them, from Postgres, MSSQL, Sybase IQ, some flavor of DB2, to Oracle, etc,

Re: [sqlite] Break on cumulative sum

2013-03-05 Thread Petite Abeille
On Mar 5, 2013, at 9:24 AM, Nico Williams n...@cryptonector.com wrote: +1 re: recursive queries. There is a standard for that (in ANSI SQL-99?): recursive 'with' clause, aka recursive subquery factoring, aka recursive common table expressions.

Re: [sqlite] Break on cumulative sum

2013-03-04 Thread Petite Abeille
On Mar 4, 2013, at 1:32 AM, James K. Lowden jklow...@schemamania.org wrote: What do you have in mind? I've benn adding some user defined functions and am thinking of creating a repository for them. All the so-called window functions from SQL:2003 (aka analytic functions): Windowed Tables

Re: [sqlite] Break on cumulative sum

2013-03-03 Thread Petite Abeille
On Mar 3, 2013, at 2:10 PM, James K. Lowden jklow...@schemamania.org wrote: There's some cruft, too. I was only demonstrating that it could be done. If you find a way to simplify it, you'll know you understand it. Ah… if only… SQLite had analytical functions… oh, well..

Re: [sqlite] SQLite equivalent to Oracle's MERGE INTO

2013-02-27 Thread Petite Abeille
On Feb 27, 2013, at 2:53 PM, James K. Lowden jklow...@schemamania.org wrote: On Mon, 25 Feb 2013 23:54:23 +0100 anydacdev anydacdev anydac...@gmail.com wrote: I was wondering what is SQLite's equivalent to: MERGE INTO x TGT USING (SELECT NAME, KEY FROM y) SRC ON (TGT.key = SRC.key)

Re: [sqlite] SQLite equivalent to Oracle's MERGE INTO

2013-02-25 Thread Petite Abeille
On Feb 25, 2013, at 11:54 PM, anydacdev anydacdev anydac...@gmail.com wrote: I was wondering what is SQLite's equivalent to: MERGE INTO x TGT There is none. Even though it's standard SQL (SQL:2003 or such), this is not supported by SQLite in any way, shape, or form. One could make do with

Re: [sqlite] column totals

2013-02-23 Thread Petite Abeille
On Feb 23, 2013, at 12:07 AM, Paul Sanderson sandersonforens...@gmail.com wrote: any ideas? As mentioned, you will need two queries and union their respective result sets. For example, assuming the following data set: create table test( key, value ); insert intotest ( key,

Re: [sqlite] SQLite on a Mac: PHP doesn't know about :-(

2013-02-22 Thread Petite Abeille
On Feb 22, 2013, at 9:51 PM, Didier Morandi didier.mora...@gmail.com wrote: set flame off. You seem to be missing the point entirely. No one mentioned anything about OOP at all, whatever that is. Merely that you may be better off using a more contemporary version of SQLite. That's all.

Re: [sqlite] BUG? sqlite not reporting error like more than one row returned by a subquery used as an expression

2013-02-20 Thread Petite Abeille
On Feb 20, 2013, at 2:15 PM, Richard Hipp d...@sqlite.org wrote: SQLite automatically adds a LIMIT 1 to a scalar subquery. Yeah… that's a bit of a death trap though… would be much more productive if SQLite would raise an exception instead of doing something covert and random...

Re: [sqlite] BUG? sqlite not reporting error like more than one row returned by a subquery used as an expression

2013-02-20 Thread Petite Abeille
On Feb 20, 2013, at 9:29 PM, Richard Hipp d...@sqlite.org wrote: On Wed, Feb 20, 2013 at 3:25 PM, Petite Abeille petite.abei...@gmail.comwrote: On Feb 20, 2013, at 2:15 PM, Richard Hipp d...@sqlite.org wrote: SQLite automatically adds a LIMIT 1 to a scalar subquery. Yeah… that's

<    1   2   3   4   5   6   >