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] SQL 2003 in sqlite

2013-11-16 Thread Petite Abeille
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 this will fly in practice :) Two main issues: (1) ‘or ignore’ is most likely inappropriate

Re: [sqlite] SQL 2003 in sqlite

2013-11-16 Thread Kees Nuyt
On Sat, 16 Nov 2013 17:19:06 +0100, Petite Abeille wrote: > >On Nov 16, 2013, at 4:11 PM, James K. Lowden wrote: > >> The logical equivalent of MERGE is accomplished by one INSERT and one >> UPDATE inside a user-defined transaction. Given

Re: [sqlite] SQL 2003 in sqlite

2013-11-16 Thread Petite Abeille
On Nov 16, 2013, at 4:11 PM, James K. Lowden 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

Re: [sqlite] SQL 2003 in sqlite

2013-11-16 Thread Simon Slavin
On 16 Nov 2013, at 3:11pm, James K. Lowden wrote: > http://www.schemamania.org/sql/#some.rows > > 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.

Re: [sqlite] SQL 2003 in sqlite

2013-11-16 Thread James K. Lowden
On Wed, 13 Nov 2013 19:03:44 + Simon Slavin wrote: > I'm wondering what particular thing MERGE does that this person > needs, which doesn't happen if they use just the single commands > INSERT OR REPLACE or UPDATE OR REPLACE. On Wed, 13 Nov 2013 20:31:25 +0100 Petite

Re: [sqlite] SQL 2003 in sqlite

2013-11-13 Thread Alek Paunov
On 12.11.2013 10:45, Sylvain Pointeau wrote: The merge statement is really missing in sqlite... Definitely it is missing ... for maybe 0.05% of the (advanced) SQLite users :-). Much large group missing UPDATE and DELETE statements over joins at first place. Is there any plan to integrate

Re: [sqlite] SQL 2003 in sqlite

2013-11-13 Thread Petite Abeille
On Nov 13, 2013, at 8:03 PM, Simon Slavin 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

Re: [sqlite] SQL 2003 in sqlite

2013-11-13 Thread Simon Slavin
On 13 Nov 2013, at 6:51pm, Petite Abeille wrote: > > On Nov 13, 2013, at 4:38 PM, Simon Slavin wrote: > >> I still don't know what function that MERGE does that you can't do in SQLite. > > Are you asking what MERGE does? I'm wondering what

Re: [sqlite] SQL 2003 in sqlite

2013-11-13 Thread Petite Abeille
On Nov 13, 2013, at 4:38 PM, Simon Slavin 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 Simon Slavin
On 13 Nov 2013, at 2:15pm, Sylvain Pointeau wrote: > Hi, > >> INSERT (OR REPLACE/IGNORE) INTO table1 SELECT * FROM table2 >> Do you have specific requirements for the UPDATE features of MERGE ? > > the issue with "insert or replace" is that it will match on primary

Re: [sqlite] SQL 2003 in sqlite

2013-11-13 Thread Hick Gunter
-Ursprüngliche Nachricht- Von: Sylvain Pointeau [mailto:sylvain.point...@gmail.com] Gesendet: Mittwoch, 13. November 2013 15:16 An: General Discussion of SQLite Database Betreff: Re: [sqlite] SQL 2003 in sqlite Hi, > INSERT (OR REPLACE/IGNORE) INTO table1 SELECT * FROM table2 Do you > ha

Re: [sqlite] SQL 2003 in sqlite

2013-11-13 Thread Sylvain Pointeau
Hi, > INSERT (OR REPLACE/IGNORE) INTO table1 SELECT * FROM table2 > Do you have specific requirements for the UPDATE features of MERGE ? the issue with "insert or replace" is that it will match on primary keys, additionally (I am not 100% sure) it deletes first the row to replace it. we cannot

Re: [sqlite] SQL 2003 in sqlite

2013-11-12 Thread Petite Abeille
On Nov 12, 2013, at 9:49 AM, Simon Slavin 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

Re: [sqlite] SQL 2003 in sqlite

2013-11-12 Thread Simon Slavin
On 12 Nov 2013, at 8:45am, Sylvain Pointeau wrote: > The merge statement is really missing in sqlite... SQLite does have this form of the INSERT statement: INSERT (OR REPLACE/IGNORE) INTO table1 SELECT * FROM table2 Do you have specific requirements for the UPDATE