On Tue, 24 Sep 2013 20:21:09 +0200
Petite Abeille wrote:
> On Sep 24, 2013, at 8:05 PM, Simon Slavin
> 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 mor
To make clearer my former post, (not arguing against the current
bahaviour of "INSERT OR REPLACE"), the usage (and misunderstanding) I
had with INSERT OR REPLACE was a simple shortcut of 2 statements :
- DELETE : erasing completely old values, with a constraint that no
deletion should occur if
Thanks a lot for your explanations. I misread the doc...
I intuitively thought that INSERT OR REPLACE operates only on a "one
input -> one affected record" ("or in place") logic (as exercised for
the PK constraint) and that UNIQUE constraint had some higher priority
against "replace" : a kind
On Mon, Sep 23, 2013 at 12:19 PM, Jean-Marie CUAZ wrote:
> Hello,
>
> Thanks to SQlite developement team for this wonderfull library
>
> We have been hit today by the following :
>
> package require sqlite3
>
> sqlite3 db1 test
>
> db1 eval {CREATE TABLE T1 (A PRIMARY KEY, B, C, D UNIQUE DEFAULT
On Sep 24, 2013, at 8:16 PM, Simon Slavin 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 that so? If 'INSERT O
On 24 Sep 2013, at 7:19pm, Marc L. Allen wrote:
> INSERT OR IGNORE?
Dammit, yes. I meant INSERT OR IGNORE, not INSERT OR FAIL. Thanks Marc.
Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo
On Sep 24, 2013, at 8:05 PM, Simon Slavin 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.
___
sqlite-users
eille
Sent: Tuesday, September 24, 2013 2:14 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Bug : Tcl interface + "INSERT OR REPLACE" statement
On Sep 24, 2013, at 8:09 PM, Marc L. Allen wrote:
> Not complaining, mind you. MS SQL doesn't have it, and I've
INSERT OR IGNORE?
-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org]
On Behalf Of Simon Slavin
Sent: Tuesday, September 24, 2013 2:16 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Bug : Tcl interface + "INSE
On 24 Sep 2013, at 7:09pm, Marc L. Allen wrote:
> Also, there are times when you do a bulk insert, so you have to structure the
> query to not fail on records that are already present.
Yeah. Actually I got what I posted wrong. I should have written
Which is why you do an INSERT OR FAIL, the
On Sep 24, 2013, at 8:09 PM, Marc L. Allen 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
__
On Sep 24, 2013, at 8:06 PM, Marc L. Allen 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
http://sqlite.org:8080/cgi-bin/m
PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Bug : Tcl interface + "INSERT OR REPLACE" statement
On 24 Sep 2013, at 6:58pm, Petite Abeille wrote:
> On Sep 24, 2013, at 7:54 PM, "Marc L. Allen"
> wrote:
>
>> Yep. What most people want is
On Sep 24, 2013, at 7:54 PM, "Marc L. Allen"
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… 'ON
CONFLICT clause' cons
on of SQLite Database
Subject: Re: [sqlite] Bug : Tcl interface + "INSERT OR REPLACE" statement
On Sep 24, 2013, at 7:54 PM, "Marc L. Allen"
wrote:
> Yep. What most people want is an INSERT OR UPDATE.
Yep. Which is what one usually calls 'MERGE':
http://en.wik
On 24 Sep 2013, at 6:58pm, Petite Abeille wrote:
> On Sep 24, 2013, at 7:54 PM, "Marc L. Allen"
> 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 p
] Bug : Tcl interface + "INSERT OR REPLACE" statement
On Sep 23, 2013, at 6:19 PM, Jean-Marie CUAZ 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 defin
On Sep 23, 2013, at 6:19 PM, Jean-Marie CUAZ 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 exactly what i
Hello,
Thanks to SQlite developement team for this wonderfull library
We have been hit today by the following :
package require sqlite3
sqlite3 db1 test
db1 eval {CREATE TABLE T1 (A PRIMARY KEY, B, C, D UNIQUE DEFAULT '-')}
db1 eval {INSERT INTO T1 VALUES (0, 1, 1, 'a') , (1, 1, 1, 'b') , (
19 matches
Mail list logo