On 2/17/20, The Tick <the.t...@gmx.com> wrote: > sql eval { insert into test (id, number, data) values( $a, $b, $c ) }
What were you hoping to accomplish here? It seems like you might be wanting the rowid of the last insert by any database connection into the "test" table. If so, that is not what last_insert_rowid() does. The last_insert_rowid() is the rowid of the most recent insert from the current database connection into *any* table. The SQLite database file does not keep track of the order of inserts, and so it cannot determine the last insert on any particular table. It only has that information for an individual connection. And it only keeps a single integer which applies to the most recent insert, regardless of what table was inserted into. If you need to track the last insert into individual tables, and do so globally, you can accomplish that using triggers. To get the last_insert_rowid() from TCL, it is faster to use the "db last_insert_rowid" TCL command. -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users