简体   繁体   English

SQLite是否有类似insert_id的内容?

[英]Does SQLite have something like insert_id?

I have ac# project that uses sqlite and I wonder if there is something like the mysql_insert_id method as in php ? 我有一个使用sqlite的ac#项目,我想知道是否有类似php中的mysql_insert_id方法?

Thanks 谢谢

对于SQLite3, SELECT last_insert_rowid()应该可以正常工作,如下所述: 如何使用Zend_Db获取Sqlite数据库的最后插入ID。

The SQLite base API (in C) has sqlite3_last_insert_rowid which looks ideal for this sort of thing. SQLite基本API(用C语言sqlite3_last_insert_rowid )具有sqlite3_last_insert_rowid ,它看起来非常适合此类情况。 It's also available at the SQL level via the last_insert_rowid() function. 也可以通过last_insert_rowid()函数在SQL级别上使用。 I don't know how this maps to C#, but that should help you when looking. 我不知道它是如何映射到C#的,但是在查找时应该可以为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM