开发者

Last inserted id from SQLite in FireFox add-on

开发者 https://www.devze.com 2023-02-08 04:13 出处:网络
im writing addon for firefox and use SQLite trough XPCOM. Can anyone explain how to get last in开发者_JS百科serted id from autoincrement column?You can use the lastInsertRowId on the connection.Howev

im writing addon for firefox and use SQLite trough XPCOM.

Can anyone explain how to get last in开发者_JS百科serted id from autoincrement column?


You can use the lastInsertRowId on the connection. However, you should avoid using synchronous statement execution, which means you cannot rely on that property. You'll have to run another SQL query to get that value.


you can use

SELECT last_insert_rowid();

0

精彩评论

暂无评论...
验证码 换一张
取 消