getting last insert id from SQLite autoincrement column

Trevor DeVore lists at
Wed Jul 11 14:25:17 EDT 2007

On Jul 11, 2007, at 2:06 PM, David Beck wrote:
> I have not been able to find out how to get the last insert id  
> after inserting a record into a SQLite table with the PRIMARY KEY  
> AUTOINCREMENT flags set. I'm sure I must be missing something? I  
> have searched through SQLite docs and rev mailing lists to no  
> avail. Can anybody shed some like on this issue? (LAST_INSERT_ID()  
> does not seem to be implemented in SQLite.) Thanks in advance.

For SQLite you can execute the following query using revDataFromQuery  
to get the last inserted id:

SELECT last_insert_rowid()

Trevor DeVore
Blue Mango Learning Systems    -
trevor at

More information about the Use-livecode mailing list