Python相当于Java语句.getGeneratedKeys()?

2024-10-04 09:20:45 发布

您现在位置:Python中文网/ 问答频道 /正文

Python的sqlite3模块中是否有类似于Java的API语句.getGeneratedKeys()? 如果没有,用sqlite3在Python中获得最近自动生成的键的最佳方法是什么?在


Tags: 模块方法api语句javasqlite3getgeneratedkeys
1条回答
网友
1楼 · 发布于 2024-10-04 09:20:45

{cdite>需要使用函数。从SQLite documentation

The last_insert_rowid() function returns the ROWID of the last row insert from the database connection which invoked the function. The last_insert_rowid() SQL function is a wrapper around the sqlite3_last_insert_rowid() C/C++ interface function

相关问题 更多 >