getting last insert id from SQLite autoincrement column

Trevor DeVore lists at mangomultimedia.com
Wed Jul 11 13:25:17 CDT 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
www.bluemangolearning.com    -    www.screensteps.com
trevor at bluemangolearning.com





More information about the use-livecode mailing list