Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 C/C++ 中将多个 sqlite 文件连接到一个 sqlite3* 句柄中?我认为有可能考虑到有一个名为 ATTACH 的命令,但不知道如何在 C++ 中这样做。提前致谢。
回答(感谢罗伯特)
sqlite3_exec(db, "ATTACH 'C:/tmp/tmp.sqlite' as mytmp");
执行ATTACH DATABASESQL 命令:
ATTACH DATABASE
ATTACH path_to_database AS database-name
然后,您可以将附加数据库中的表称为:
database-name.table-name
http://www.sqlite.org/lang_attach.html