Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-30 Thread Daniel Önnerby
er 2007 20:12 An: sqlite-users@sqlite.org Betreff: Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid() As has been carefully explained by several people, it is reliable. You just did not think through your application. You could make an extension to Sqlite and

RE: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-30 Thread Michael Ruck
r 2007 20:12 > An: sqlite-users@sqlite.org > Betreff: Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid() > > As has been carefully explained by several people, it is reliable. > You just did not think through your application. You could make an > extension to Sqlite

Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-29 Thread John Stanton
As has been carefully explained by several people, it is reliable. You just did not think through your application. You could make an extension to Sqlite and implement an sqlite3_last_insert_or_ignore_id function, but to blithely assume that you can use last_insert_id with INSERT OR IGNORE

Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-29 Thread Simon Davies
On 29/10/2007, Odekirk, Shawn <[EMAIL PROTECTED]> wrote: > Adding "primary key" to column "a" results in the behavior I think you > were first expecting. > > sqlite> create table tmp (a integer primary key, b integer); > sqlite> create unique index tmpIndex on tmp (a, b); > sqlite> insert into tmp

Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-29 Thread Kees Nuyt
[Default] On Mon, 29 Oct 2007 15:00:51 +0100, "Michael Ruck" <[EMAIL PROTECTED]> wrote: >I don't get an error code. So how should I decide if I should call >sqlite3_last_insert_rowid() or not? :) That's the problem - I don't have any >indication if an insert >was actually performed or if it was

RE: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-29 Thread Odekirk, Shawn
inal Message- From: Simon Davies [mailto:[EMAIL PROTECTED] Sent: Monday, October 29, 2007 11:02 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid() Thanks for the explanation! On 29/10/2007, Dennis Cote <[EMAIL PROTECTED]> wrote:

RE: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-29 Thread Odekirk, Shawn
This link gives a little more information: http://www.sqlite.org/autoinc.html Shawn -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: Monday, October 29, 2007 10:57 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid

Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-29 Thread Simon Davies
Thanks for the explanation! On 29/10/2007, Dennis Cote <[EMAIL PROTECTED]> wrote: > Simon Davies wrote: > > Following this thread, I was experimenting with last_insert_rowid(), > > and found the following, which does not look right: > > > > SQLite version 3.4.2 > > Enter ".help" for instructions

Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-29 Thread Dennis Cote
Simon Davies wrote: Following this thread, I was experimenting with last_insert_rowid(), and found the following, which does not look right: SQLite version 3.4.2 Enter ".help" for instructions sqlite> sqlite> create table tmp( a integer, b integer ); sqlite> create unique index tmpIndex on tmp(

Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-29 Thread Dennis Cote
Michael Ruck wrote: I don't get an error code. So how should I decide if I should call sqlite3_last_insert_rowid() or not? :) That's the problem - I don't have any indication if an insert was actually performed or if it was simply ignored - thus I don't have any possibility to decide if the call

Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-29 Thread Simon Davies
Hi All, Following this thread, I was experimenting with last_insert_rowid(), and found the following, which does not look right: SQLite version 3.4.2 Enter ".help" for instructions sqlite> sqlite> create table tmp( a integer, b integer ); sqlite> create unique index tmpIndex on tmp( a, b );

Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-29 Thread Michael Ruck
I don't get an error code. So how should I decide if I should call sqlite3_last_insert_rowid() or not? :) That's the problem - I don't have any indication if an insert was actually performed or if it was simply ignored - thus I don't have any possibility to decide if the call is valid or not. This

Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-27 Thread Kees Nuyt
[Default] On Sat, 27 Oct 2007 16:26:36 +0200, "Michael Ruck" <[EMAIL PROTECTED]> wrote: >Hi, > >I have a table of unique values in the following format: > >CREATE TABLE categories (id INTEGER PRIMARY KEY, category UNIQUE TEXT) > >I want inserts into this table to succeed, even though the