Re: [sqlite] request for feature: insert or update

2013-06-27 Thread James K. Lowden
On Thu, 27 Jun 2013 12:05:00 +0200 Patrik Nilsson wrote: > Now I'm doing: "insert or ignore into table_test (id) values (1)" and > then issue an update statement. I think "insert or update" will > increase performance. The "insert or update" statement is an unnecessary complication. It adds no

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Patrik Nilsson
; > -Ursprüngliche Nachricht- > Von: Patrik Nilsson [mailto:nipatriknils...@gmail.com] > Gesendet: Donnerstag, 27. Juni 2013 15:01 > An: General Discussion of SQLite Database > Betreff: Re: [sqlite] request for feature: insert or update > > Thank you for your suggestion

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Hick Gunter
15:01 An: General Discussion of SQLite Database Betreff: Re: [sqlite] request for feature: insert or update Thank you for your suggestion! I would like to have all in one statement, then "insert or update" is perfect. This is least error prone. If you split the statement into several

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Patrik Nilsson
Thank you for your suggestion! I would like to have all in one statement, then "insert or update" is perfect. This is least error prone. If you split the statement into several, you will end up in more statements to test and more bugs. (You write "3" on two places.) Working with blobs, I expect t

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Richard Hipp
On Thu, Jun 27, 2013 at 6:05 AM, Patrik Nilsson wrote: > Hi All! > > A feature I'm missing is a syntax like with "insert or update". > > You define a table as: > "create table table_test (id as integer primary key, a as integer, b as > integer, c as integer)" > > Then you know that the "id" is uni

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Patrik Nilsson
The SQLite syntax "replace into" does almost what I want. It also erases the other values of the same line, which I don't want. On 06/27/2013 01:38 PM, Simon Slavin wrote: > > On 27 Jun 2013, at 11:05am, Patrik Nilsson wrote: > >> A feature I'm missing is a syntax like with "insert or update".

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Patrik Nilsson
On 06/27/2013 02:16 PM, Hick Gunter wrote: >> -Ursprüngliche Nachricht- Von: Simon Slavin >> [mailto:slav...@bigfraud.org] Betreff: Re: [sqlite] request for >> feature: insert or update >> >> >> On 27 Jun 2013, at 11:05am, Patrik Nilsson >> wr

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Hick Gunter
L 2 1 2 NULL -Ursprüngliche Nachricht- Von: Patrik Nilsson [mailto:nipatriknils...@gmail.com] Gesendet: Donnerstag, 27. Juni 2013 13:55 An: General Discussion of SQLite Database Betreff: Re: [sqlite] request for feature: insert or update You are right it won'

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Hick Gunter
>-Ursprüngliche Nachricht- >Von: Simon Slavin [mailto:slav...@bigfraud.org] >Betreff: Re: [sqlite] request for feature: insert or update > > >On 27 Jun 2013, at 11:05am, Patrik Nilsson wrote: > > >> Now I'm doing: "insert or ignore into table_te

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Patrik Nilsson
icht- > Von: Patrik Nilsson [mailto:nipatriknils...@gmail.com] > Gesendet: Donnerstag, 27. Juni 2013 12:55 > An: General Discussion of SQLite Database > Betreff: Re: [sqlite] request for feature: insert or update > >> >> Which circumstances are you thinking of that wou

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Hick Gunter
Nachricht- Von: Patrik Nilsson [mailto:nipatriknils...@gmail.com] Gesendet: Donnerstag, 27. Juni 2013 12:55 An: General Discussion of SQLite Database Betreff: Re: [sqlite] request for feature: insert or update > > Which circumstances are you thinking of that would cause the proposed "inse

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Simon Slavin
On 27 Jun 2013, at 11:05am, Patrik Nilsson wrote: > A feature I'm missing is a syntax like with "insert or update". > > You define a table as: > "create table table_test (id as integer primary key, a as integer, b as > integer, c as integer)" > > Then you know that the "id" is unique and you o

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread RSmith
>I'll add a vote to this request. >It's not as if it is a hard thing to do, I continuously run update algorithms something like this: Correction - re-reading my statement it sounded very wrong, please allow me to rephrase: I'll add a vote to this request. It's not as if it is difficult for us

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread RSmith
I'll add a vote to this request. It's not as if it is a hard thing to do, I continuously run update algorithms something like this: Query "SELECT Count() FROM t WHERE ID=XXX;" --> r; if (r>0) Execute "UPDATE t SET v=YYY WHERE ID=XXX;" else Execute "INSERT INTO t (XXX,YYY);" (I obviously use co

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Patrik Nilsson
iche Nachricht- > Von: Patrik Nilsson [mailto:nipatriknils...@gmail.com] > Gesendet: Donnerstag, 27. Juni 2013 12:05 > An: General Discussion of SQLite Database > Betreff: [sqlite] request for feature: insert or update > > Hi All! > > A feature I'm missing is a syntax l

Re: [sqlite] request for feature: insert or update

2013-06-27 Thread Hick Gunter
@gmail.com] Gesendet: Donnerstag, 27. Juni 2013 12:05 An: General Discussion of SQLite Database Betreff: [sqlite] request for feature: insert or update Hi All! A feature I'm missing is a syntax like with "insert or update". You define a table as: "create table table_test (i

[sqlite] request for feature: insert or update

2013-06-27 Thread Patrik Nilsson
Hi All! A feature I'm missing is a syntax like with "insert or update". You define a table as: "create table table_test (id as integer primary key, a as integer, b as integer, c as integer)" Then you know that the "id" is unique and you only can have one row with that integer. Then you can give