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( a, b );
sqlite> insert into tmp values( 1, 1 );
sqlite> insert into tmp values( 2, 2 );
sqlite> select last_insert_rowid();
2
sqlite>
sqlite> insert or replace into tmp values( 1, 1 );
sqlite> select last_insert_rowid();
3
<------ !!!???!!!
sqlite> select * from tmp;
2|2
1|1
sqlite>



Simon,

If you change your query to;

   select rowid, * from tmp;

it will display the rowid which is different than either of the fields in the table.

When doing a replace sqlite deletes the existing row and adds a new row.

HTH
Dennis Cote

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to